I'm getting tired and confused so thought I would ask here before quitting for the day.
I have created a custom post type of membercontent
Under membercontent
I have created the taxonomy membercontent_category
In the archive.php I was re-writing the title with:
...
elseif ( is_post_type_archive( 'membercontent' ) ) :
_e( 'Member Content', 'radiate' );
elseif ( get_post_type() == 'membercontent' ) :
post_type_archive_title();
else :
_e( 'Archives', 'radiate' );
endif;
This however does not show the category archive pages...
is there a get_category_title() function?
I'm getting tired and confused so thought I would ask here before quitting for the day.
I have created a custom post type of membercontent
Under membercontent
I have created the taxonomy membercontent_category
In the archive.php I was re-writing the title with:
...
elseif ( is_post_type_archive( 'membercontent' ) ) :
_e( 'Member Content', 'radiate' );
elseif ( get_post_type() == 'membercontent' ) :
post_type_archive_title();
else :
_e( 'Archives', 'radiate' );
endif;
This however does not show the category archive pages...
is there a get_category_title() function?
$category_detail=get_the_category(get_the_ID());//$post->ID
foreach($category_detail as $cd)
{
$name_category=$cd->cat_name;
$id_category=$cd->term_id;
echo $name_category;
}
this code get category name and id you just put a post id