Forums › Forums › Search & Filter Pro › Customising the Results Page – Portfolio Category names
Tagged: display portfolio category
- This topic has 3 replies, 2 voices, and was last updated 10 years, 8 months ago by
Ross.
-
Anonymous(Private) November 13, 2015 at 5:02 pm #29815
Hello,
I purchased this plugin to search and filter some portfolio categories from the Portfolio of the Enfold theme.
I am trying to make some really basic changes to the results page. For example I would like to display all the categories that a single portfolio item belongs.
How do I get the category names and display them next to the portfolio item thumbnail ?
Thank you in advance for your help and support
Alex
Ross Moderator(Private) November 14, 2015 at 11:37 am #29842Hey Alex
So to customise your results you need to figure out which display method you are using and follow the correct link on this page:
http://www.designsandcode.com/documentation/search-filter-pro/search-results/#Display_Results_Method
Then once you know how to make modification to your template file, to get the terms associated with the post you want to do something like:
https://codex.wordpress.org/Function_Reference/wp_get_post_terms
Portofio categories are just Custom Taxonomies.
Thanks
Ross Moderator(Private) November 16, 2015 at 5:50 pm #29957Hi Alex
This is the link I just mentioned.
So inside your template file, next to the thumbnail, you must add the following code:
https://codex.wordpress.org/Function_Reference/wp_get_post_terms
This will work for any Taxonomy (as mentioned above, portfolio categories are actually a Taxonomy).
So, you will need to find the internal taxonomy name of “Portfolio Categories” – this will probably be something like
portfolio_categoriesIf this is the case, then you would probably need something like the following (adapted from teh link above):
//Do something if a specific array value exists within a post $term_list = wp_get_post_terms(get_the_ID(), 'portfolio_categories', array("fields" => "all")); foreach($term_list as $term_single) { echo $term_single->name; //do something here }This should give you a start 🙂
Thanks
-
AuthorPosts