If it is a top level category show children otherwise show sibling categories
If it is a top level category show children otherwise show sibling categories
If it is a top level category show children otherwise show sibling categories
This should get you going in the right direction. echo ‘<div class=”testata_inner”>’; $cat = get_the_category($recent[“ID”]); //get the category array if ($cat[0]->name != “Featured”) { //check if the category is “featured” $catname = $cat[0]->name; //set $catname variable to “featured” } else { $catname = $cat[1]->name; //or set $catname variable to “other category name” } echo ‘<span … Read more
It seems that you need to do this inside a post. For this, you can either use has_category() or in_category to test if a post belongs to the given category, and if the condition is true, apply your changes Example: if( has_category(‘name or I’d or slug of category to test) ) { echo ‘<img src=”http://organeek.net/wp-content/uploads/2014/10/85.jpg’ … Read more
How do you add Author and date Published on Category Pages?
I have written a quite extensive post on a similar subject that you can read here. Also take your time and read all linked posts. In there I have explained why you should not be using query_posts and why you should not use custom queries in place of the main query A few things here: … Read more
Page Type with Category Link
EDIT From your comments, you are using get_cat_ID() totally wrong. You can only feed one category to it. Please follow all links given and check the examples in the codex. Also, as stated, enable debugging, because that is all problems you should have picked up Secondly, it seems that you are using a custom taxonomy … Read more
Using categories and pages in menus
This might help you to get categories of particular post $catList =get_the_category($post->ID); foreach($catList as $single){ echo $single->cat_name; } You can also check from below links get_the_category get-category-name-from-post-id
Just a note to potential downvoters and close voters, even though this question by itself is on topic, the reason that this being a core theme, make this even more on topic EDIT As you are making use of the twentyfourteen theme, you have to remember this one golden rule ( and this applies to … Read more