-
AuthorPosts
-
June 14, 2013 at 8:55 pm #24844
1) Is it possible to put description in front of every taxonomy for my CPT, for example:
—> description: Country: United Kingdom <— taxonomy
—> description: City: London <— taxonomy
and i don’t want United Kingdom or London to be links, just plain text
2) Also, is it possible to select which taxonomies to be printed when someone is using my advanced search form?
June 17, 2013 at 4:41 am #1249561) No, there’s currently no option to add a description to the taxonomy title.
2) I’m not sure what you mean – do you refer to the meta data section which lists all terms/categories of a post? If yes, you can exclude the taxonomies with a filter – add following code to the bottom of functions.php:
add_filter('avf_exclude_taxonomies', 'avia_exclude_tax', 10, 3);
function avia_exclude_tax($tax,$post_type,$id){
$tax[] = 'mytaxonomy';
return $tax;
}Instead of “mytaxonomy” insert the name of the taxonomy you want to exclude. If you want to exclude several taxonomies use:
$tax[] = 'mytaxonomy';
$tax[] = 'mysecondtaxonomy';June 17, 2013 at 7:37 am #124957Thanks for your reply Dude,
1) For my first question, if there is no option for DESCRIPTION (Please consider adding it for the next update :) ), can I at least disable the linking? I want them as regular text.
2) Perfect
June 18, 2013 at 10:10 am #124958Hi,
You can use something like this to identify what the taxonomy is to add the description: Just change the country and city to whatever your taxonomy names are
$tax_description="";
if ( is_tax( 'country' )){
$tax_description ='Country: ';
} elseif ( is_tax( 'city' )) {
$tax_description ='City: ';
}and then add $tax_description to wherever you are displaying the taxonomy (i cant answer better since i dont see any of your code)
echo $tax_description . (your current code that displays the taxonomy);
http://codex.wordpress.org/Function_Reference/is_tax
Thanks,
Nick
June 18, 2013 at 5:21 pm #124959Hey Nick, thanks for your reply !!!
Will try it tonight, and write you to let you know how it goes ;)
June 20, 2013 at 6:07 am #124960Hi!
I set the status to resolved.
Best regards,
Peter
-
AuthorPosts
- The topic ‘Taxonomies’ is closed to new replies.