Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9017961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:24:03+00:00 2026-06-16T04:24:03+00:00

Basically I’ve created a custom post type in WordPress with a custom taxonomy (custom_tax).

  • 0

Basically I’ve created a custom post type in WordPress with a custom taxonomy (custom_tax). Now I’ve created a custom query in which I’d like to grab the custom category in which the custom post was saved and output its name as a string. I was doing this while working with WordPress standard taxonomy:

//Start the query
   query_posts(array(
  'showposts' => $posts,
  'orderby' => 'asc',
  'category_name' => $category
));

$temp_title = get_the_title();
$temp_link = get_permalink();
$temp_excerpt = get_the_excerpt();
$temp_time = get_the_date('Y-m-d');
$temp_categories = get_the_category(', ');
$temp_author = get_the_author();
$temp_content = get_the_content();
$i++;

$output2 .= "<li class='item' data-id='id-" . $i . "' data-type='" . $temp_categories . "'><a href='" . $temp_link . "' rel='prettyPhoto[portfolio]'><img class='' src='" . $path . "/library/timthumb.php?src=" . $image[0] . "&h=130&w=210&zc=1&q=100' alt='" . $temp_title . "' /></a></li>";

and it worked like a charm. Now I need to use custom post and custom taxonomy and have tried many variations of this:

//Start the query
query_posts(array(
  'post_type' => array('post', 'portfolio'),
  'showposts' => $posts,
  'orderby' => 'asc',
  'category_name' => $category
));

$temp_title = get_the_title();
$temp_link = get_permalink();
$temp_excerpt = get_the_excerpt();
$temp_time = get_the_date('Y-m-d');
$temp_categories = get_the_terms( get_the_ID(), 'custom_cat', ', ' );
$temp_author = get_the_author();
$temp_content = get_the_content();
$i++;

$output2 .= "<li class='item' data-id='id-" . $i . "' data-type='" . $temp_categories . "'><a href='" . $temp_link . "' rel='prettyPhoto[portfolio]'><img class='' src='" . $path . "/library/timthumb.php?src=" . $image[0] . "&h=130&w=210&zc=1&q=100' alt='" . $temp_title . "' /></a></li>";

And it doesn’t work. I’ve tried get_the_terms(), the_terms() and get_terms() but none worked like get_the_category() worked before – it was outputting a string with the category name. Wha am I missing?

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:24:04+00:00Added an answer on June 16, 2026 at 4:24 am

    WordPress describes taxonomies as “Terms”. There may be some help in their documentation on “get_terms()” found here. If you want to sort by terms there is a great post on the wordpress forums to do just that!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically like the opposite of Math.pow() . I want a function which can be
Basically, I'm using this query to group a bunch of users based on the
Basically I need some text like: I have an ice cream cone. You are
Basically I have a TcxGrid which will be listing various files names and I'd
Basically what I'm trying to do is generate an alphanumeric string, which is passed
Basically I have an entity (called Session) which will provide many different Services. Each
Basically I would like to have some dictionary that is an abstaction over legacy
Basically, I have something like the following: public string SomeDBMethod(string server, string dbName, string
Basically, when I type these commands in the terminal by hand, the sift program
Basically i've a table for my users (it's nightclub website) and now i'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.