Support » Plugin: WP Store Locator » Add categories to search results

  • Resolved leffi7



    I’ve been searching for a way to display the category or categories (if multiple checked) of a store in the search result list.

    Not sure, but with the wpsl_listing_template filter, I am able to modify the results.
    Now I only need to find out where the categories are stored and how to call them.

    Your help is very much appreciated.

    Thank you.


Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tijmen Smit


    This code will add the terms to the returned search results. You can then show with this filter.

    If you use the code in the usage section, then replace this:

    $listing_template .= "\t\t\t" . '<% if ( my_textinput ) { %>' . "\r\n";
    $listing_template .= "\t\t\t" . '<p><%= my_textinput %></p>' . "\r\n";
    $listing_template .= "\t\t\t" . '<% } %>' . "\r\n";

    With this:

    $listing_template .= "\t\t\t" . '<% if ( terms ) { %>' . "\r\n";
    $listing_template .= "\t\t\t" . '<p><%= terms %></p>' . "\r\n";
    $listing_template .= "\t\t\t" . '<% } %>' . "\r\n";
    Thread Starter leffi7


    Thank you Tijmen!

    I will give it a try asap!

    I found this thread, but am still unable to get my categories to show with the search results. Is there any updated code that needs to be replaced, or any additional help that can be offered?


    Plugin Author Tijmen Smit


    This article describes how to make it work.

    Perfect! Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add categories to search results’ is closed to new replies.