I have a WP site here:
As you can see each post on the front page Posted in "Child categories" "I would like to say something like this in" Parents category "- 'Child categories'.
This is the code that needs to be edited, in content.php:
Thanks for reading any help would be greatly appreciated.
Try this: (taken from this post :):
Before closing, below your functions .ff file? & Gt; Tag
function get_top_category () {$ cats = get_the_category (); // Category object top_cat_obj = array (); Foreign ($ cat $ cat) {if ($ cat- & gt; Parents == 0) {$ top_cat_obj [] = $ cat; }} $ Top_cat_obj = $ top_cat_obj [0]; Return $ top_cat_obj; } Modify your content.php:
& lt ;? Php $ top_cat = get_top_category () ;? & Gt; & Lt ;? Php printf (__ (posted in '% 1 $ s', 'Underground_sound'), $ top_cat-> slug. '-'. $ Categories_list); ? & Gt;
No comments:
Post a Comment