June 9, 2015 at 11:21 pm #37992squintsMember
I am building a business directory similar to YP (but free) and I am using Geo My WP for my frontend search form so my users can find a business in there area. Currently the results page displays ALL of the taxonomies associated with each business and I only want to display a certain few of the custom taxonomies on the results list page since I have quite a few custom taxonomies associated with each listing and it looks weird in the results. I only want to display a few certain taxonomies in the results list and if the user wants more info they can click the business name to see all the other taxonomies/info.
The taxonomies are displayed on the results page using the following function:
and in “settings” there’s only the option to display all taxonomies or none.
How can I either edit this function so that I can specify which taxonomies to display and which ones to exclude, or replace the function with something else that can pull individual taxonomies rather than ALL of them.
For example; currently each listing has the following taxonomies: Days, Times, Categories, Services, Zip Code, Features, Rental, Customer Service, Drive Through, Size, Building/Strip Name, Number of Employees, Etc.
But the only taxonomies I want to display on the results pages are Days, Times, Categories and Services.
Any help is greatly appreciated!!June 9, 2015 at 11:28 pm #37993Eyal FitoussiMember
The function includes a filter which allows you to pass only the taxonomies that you’d like to display.
the filter is:1apply_filters( 'gmw_pt_results_taxonomies', get_object_taxonomies( $post->post_type, 'names' ), $gmw, $post );
You will need to use the function to return an array of the taxonomies that you want to use.June 10, 2015 at 7:52 am #38007squintsMember
Doesn’t the function
get_object_taxonomiesreturn all of the taxonomies associated with a post? I tried to play around with this function but I do not understand where to list the taxonomies I want to include or exclude. Can you please give me an example of how to structure this function to either include or exclude taxonomies?
Also, am I supposed to make the change to geomywp/plugins/post/includes/gmw-pt-template-functions.php?
You must be logged in to reply to this topic.