Forums Forums Search & Filter Pro search results and widget logic

Viewing 3 posts - 1 through 3 (of 3 total)
  • Ross Moderator
    #12065

    Hey Nemanja

    I think you can configure widget logic to use the URL? I don’t use it personally so can’t advise but I had a user mention this to me.

    Also, the “widget logic code” you posted is perfectly normal template code, so in the scenario of a template, to identify a search form I would use:

    global $sf_form_data;
    if ( $sf_form_data->is_valid_form() )
    {
        //do stuff
    }

    Not sure how you can change your code but I would try to do something like:

    “is_category(array(57,76,77,78)) || (is_single() && in_category(76)) || (is_single() && in_category(77)) || (is_single() && in_category(78)) || (is_single() && in_category(57)) || is_page(1601)||$sf_form_data->is_valid_form()”

    However somewhere you must initialise the global in the first example.

    Thanks

    Anonymous
    #12087

    Hello well it would be nice for people to have this option since it s a search widget people need to show the widget on search results page rather than going back

    Anyways i fixed the error with the normal widgetlogic plugin

    is_category(array(57,76,77,78)) || (is_single() && in_category(76)) || (is_single() && in_category(77)) || (is_single() && in_category(78)) || (is_single() && in_category(57)) || is_search()

    So you can put this in your documentation if someone needs
    The above code means that the widget will show on category pages with ID 57,76,77,78
    It will also show up on single posts that are in categories 57,76,77,78
    and it will also show on the search result page

    Thank you for replying though, very nice jb with the plugin

    Ross Moderator
    #12408

    Ah so the is_search() allowed it to be shown on the search results page?

    Thanks for the update and the info!

    🙂

Viewing 3 posts - 1 through 3 (of 3 total)