How to show the currently selected title only

Forums › Forums › Search & Filter Pro › How to show the currently selected title only

Viewing 2 posts – 21 through 22 (of 22 total)
  • Trevor
    #108630

    I suspect that ‘All Categories’ has no value attached to it, so you would have to test what you get from the code, and if it is empty then it would need to print ‘All Categories’ to the page title.

    Anonymous
    #108703

    GOT IT!!!

    global $searchandfilter;
    
     $sf_current_query = $searchandfilter->get(504)->current_query()->get_array();
    
     if (empty($sf_current_query)) {
        echo ('All Articles');
        }
     else {
       echo $sf_current_query['_sft_category']['active_terms'][0]['name'];
     }

    The above code worked like a charm, I also use the “Archive” setting as you suggested! Thanks so much for your help on this one!! Finally working properly!! 🙂

Viewing 2 posts – 21 through 22 (of 22 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.