Displaying Selected Facets (above results or in HTML title)

  • mcl7
    Participant
    3 years, 9 months ago #23811

    I am coming back around to this to post this separately from a pervious post:

    A few minor questions

    Is there documentation for displaying selected facets above the search results and also in the HTML title?

    Here is the code you recommended:

    add_action( ‘after_setup_theme’, function () {
    add_filter( wpsolr\core\classes\WPSOLR_Events::WPSOLR_FILTER_SEO_PAGE_META_VALUE, ‘wpsolr_filter_seo_page_meta_value’, 10, 1 );
    } );
    };
    function wpsolr_filter_seo_page_meta_value( $value ) {
    global $wpsolr_seo_meta;
    // Store $value
    $wpsolr_seo_meta = $value;

    return $value;
    }

    wpsolr
    Keymaster
    3 years, 9 months ago #23815

    You can insert the facets widget where your want. You can probably manage to display it in a row with some css, or using select2 layouts.

    mcl7
    Participant
    3 years, 9 months ago #23901

    I’m sorry for not being clear. What I am trying to do is display only the facets selected by the user above the results (either above or below the H1). I don’t think I can accomplish that with the Facets widget which is already on the page?

    wpsolr
    Keymaster
    3 years, 9 months ago #23905

    My mistake.
    The code you mentioned above is valid if you use a SEO add-on (Yoast, All In One SEO). It stores the SEO meta title or description in a global variable that you can use in your php templates.

    mcl7
    Participant
    3 years, 9 months ago #23935

    Correct me if I am wrong but I thought I had seen a post where this was being discussed.
    Just to be clear, what I am trying to be do is seen in the following image where “Adidas” was the selected filter:

    https://ibb.co/8NmkWd7

    The goal here is to make sure that it’s clear to the user (especially when the URLs are shared) that the page they are viewing is filtered.

    Thoughts?

    wpsolr
    Keymaster
    3 years, 9 months ago #23981

    Breadcrumbs of selected facets is not a feature of the plugin.

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

You must be logged in to reply to this topic.