• Resolved jpanizzoli

    (@jpanizzoli)


    My website is setup in such a way that some of my category pages have products displayed on them, and I’d like to have “related posts” from other (non product) categories listed in the sidebar. For example, if I have Blue Widgets displayed on a category page, I’d like to show informational posts about Blue widgets from other categories. On the Red Widget page, I want to display informational posts about Red Widgets. There are multiple product pages that I want to display related posts on. I hope that makes sense…

    To accomplish this, I thought I could use the “Get posts from this search” feature and set the search term to either the category slug or page title of that page. So on the Blue Widget page, the plugin would use the title “Blue Widgets” as the search term and post those results on the page.

    I searched the forum and read that you could use %s in the search term field, but the results aren’t very accurate. I’m assuming it’s searching for the term “blue widgets” in the post content (rather than title) and returning all the results.

    Are there other functions I can use to return related posts, or is there another way to make the results more accurate?

    THANKS FOR YOUR HELP!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Aldo Latino

    (@aldolat)

    If I correctly understood your question, you could use multiple instances of Posts in Sidebar and activating them only when needed. So if you’re on category X page, the widget searching for “String A” should be displayed; if you’re on category Y page, the widget searching for “String B” should be displayed instead.

    If so, you could use the Widget Logic plugin that will show a particular widget only under certain conditions, as said before.

    After having installed Widget Logic, prepare at least two widget of Posts in sidebar, where you define the search, for example “Text Search”. Then, at the bottom of the widget, set the correct condition (is_category(X)) and the widget will be displayed only if the condition is satisfied. Make the same for the other widget.

    Let me know.

    Thread Starter jpanizzoli

    (@jpanizzoli)

    Yup… that solved it!

    It took quite a bit of work for me to create separate widgets for each category, but the Widget Logic plugin allowed me to display unique lists of related posts for each…

    THANKS FOR YOUR HELP!

    Plugin Author Aldo Latino

    (@aldolat)

    You’re welcome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Posting unique results based upon keyword…’ is closed to new replies.