Support » Plugin: Widget Options - Add Context To WordPress Widgets » Show widget with CPT search results

  • Resolved OsakaWebbie

    (@osakawebbie)


    I installed this plugin to show a context-based widget (called “Style Guide Navigation”) whenever anything related to a certain custom post type. I’m able to show it for the top page of that section, single posts of the “guideline” post type, and archives of the related custom taxonomy “guideline_topic”. So far, so good. But I’m also offering a search of that CPT, using the Ivory Search plugin, and I can’t figure out how to show the widget on the search results page (e.g. https://japanharvest.org/?s=comma&id=5515&post_type=guideline). The “Search” selection on the Misc tab shows the widget for normal PT=”post” search (which I don’t want, but I thought perhaps I’d just hide it with CSS), but still doesn’t show it for the CPT search. What can I do?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Mej de Castro

    (@mej)

    Hi @osakawebbie,

    I would suggest the use of Display Logic. 🙂

    I hope this will help https://widget-options.com/features/display-widget-logic/

    Cheers,
    Mej

    OsakaWebbie

    (@osakawebbie)

    Thanks. But that appears to require deep knowledge of the inner workings of WordPress functions – I would have no idea what code to include. (I do speak PHP, but I know very little about WP functions and hooks.) In total, I need it to appear on:

    • one page (https://japanharvest.org/style-guide, id=1813)
    • all single post views for CPT “Guideline”
    • when search results of that CPT are shown as a result of Ivory Search, which seems to be when the URL contains &id=5515. (I assumed the other parameter in the URL, &post_type=guideline, was designating the CPT, but apparently not – it’s the ID bit that matters!)

    It’s really weird that if I enable Visibility -> Misc -> Search, the widget won’t show when &id=5515 is in the URL, even though it shows for any other search result.

    Plugin Support Mej de Castro

    (@mej)

    Hi @osakawebbie,

    Thank you for your reply. Could you please open a support ticket here https://widget-options.com/contact/?

    I’ll be happy to assist you further to address this concern.

    Thank you,
    Mej

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.