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

  • This topic has 21 replies, 2 voices, and was last updated 9 years ago by Anonymous.
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)