Custom Taxonomy Support
-
I am changing the structure of my site and added a new taxonomy on top of tags and categories. How can I display a custom taxonomy in the shortcode output?
I also need “taxonomyname-termname” class in the html similar to category for design reasons.
Thanks
-
I’ll check on the latter as for the former you need to add two arguments to the shortcode taxonomy_type= and taxonomy=. The taxonomy_type= is the custom one you created and taxonomy= is the name of the individual taxonomies under the newly created taxonomy type. If more than one used separate with commas.
Okay adding taxonomy_type=”custom” taxonomy=”term” works in showing me listings of just that taxonomy but I have hundreds of terms and “all” does not seem to work here. I am filtering by keyword fyi and do not need to filter by taxonomy.
How can I show all posts and simply include the new taxonomy in the network ext posts output rather than filter by it.
I am hoping for output that looks like:
– Wrapper has classes category-term and customtaxonomy-term
– Title (permalink to title)
– Category (permalink to category)
– Custom Taxonomy (permalink to custom taxonomy)My current shortcode is:
[netsposts filter_by_title_keywords=’keyword’ include_link_title=’true’ include_blog=’2,3′ show_categories=’true’ taxonomy_type=”customtaxonomy” taxonomy=”” paginate=’false’ meta_info=’false’ titles_only=’true’ list=’100′]Okay you want the wrapper to automatically have those classes. Instead of customtaxonomy-term it will probably be customtaxonomy-id and category-id (which is already included). Now to show those links use the following.
Add show_tags=’true’ and show_categories=’true’ to see if they show the categories and tags. They should but if they don’t I will need to fix that.
Here would be your updated code:
[netsposts filter_by_title_keywords='keyword' include_link_title='true' include_blog='2,3' show_categories='true' taxonomy_type='customtaxonomy' taxonomy='' paginate='false' meta_info='false' titles_only='true' list='100' show_tags='true' show_categories='true']Note: You may leave out taxonomy_type and taxonomy if you are only going to filter by keywords.
-
This reply was modified 6 years, 5 months ago by
johnzenausa. Reason: Leave out taxonomy_type and taxonomy
Thanks. customtaxonomy-id class would be great! and yes category-id is already included and working fine.
show_tags and show_categories both work so I guess what I am looking for is show_customtaxonomy=’true’ if possible
With customtaxonomy-id class and show_customtaxonomy option I would be golden in my project.
Okay
Check it out (new update) and see if it works the way you like. Made it to insert “tags” css classes in form of “tag-tag_slug”
I updated the shortcode but custom taxonomy does not display:
[netsposts filter_by_title_keywords='keyword' include_link_title='true' include_blog='2,4' paginate='false' meta_info='true' titles_only='true' list='100' show_tags='true' show_categories='true' show_custom_taxonomies='true']I do see a div called “netsposts-terms” but its empty. Any ideas what I am missing?
Do you mean not showing custom taxonomies in list or not showing the custom taxonomy name with a link to it.
Not showing the custom taxonomy with link in a network post listing. It currently only shows the category taxonomy term.
Give me a link so I can see what you’re talking about. I may have given you the wrong shortcode.
Not live to public but here is a screenshot: https://imgur.com/onJ6V8V
What you see is red = site 1, blue = site 2, preview and online are categories. I would like to add custom taxonomy underneath and use custom taxonomy class to add an icon.
I am not using any tags on posts since the custom taxonomy that came with the wordpress theme i am using and has more fields specific to my needs.
Let me know. Thanks
Okay I think I’m finished I just need to test it out. Should be done by the end of this week.
I have added the following to the plugin, hopefully it will help you out.
1) Added arabic language support. 2) Created 'show_custom_taxonomies' 3) Created 'show_custom_taxonomy_icon'. - Shows green icon before each custom taxonomy 4) Checked "excerpt length" functionality. Plugin already contains both versions for letters and words: excerpt_length/excerpt_letters_length and manual_excerpt_length/manual_excerpt_letters_length. 5) Added functionality to trim titles by words and letters: title_length/title_length_characters. 6) Plugin already inserted category css classes in form of "category-category_slug" in div.netsposts-content. 7) Made it to insert "tags" css classes in form of "tag-tag_slug".show_custom_taxonmies='true'and I have a generic icon ofshow_custom_taxonomy_icon='true'.-
This reply was modified 6 years, 4 months ago by
johnzenausa.
Hmm show_custom_taxonomies=’true’ does not show custom taxonomy terms on post listing for me. I still just see category. Any Ideas?
My shortcode is the following:
[netsposts filter_by_title_keywords='keyword' include_link_title='true' include_blog='2,4' paginate='false' meta_info='true' titles_only='true' list='100' show_categories='true' show_custom_taxonomies='true' show_custom_taxonomy_icon='true'] -
This reply was modified 6 years, 5 months ago by
The topic ‘Custom Taxonomy Support’ is closed to new replies.