• Hello Mikka:

    I am trying to create two search widgets one for posts, and the second for a custom post type “wprss_feed_item.” I have made use of the shortcode [searchform post_types=”post”] and [searchform post_types=”wprss_feed_item”].

    Neither of these search widgets find any results.

    On the same page, I can use the standard wp search, and it will find “posts.”

    I have successfully indexed both posts types and unchecked “Respect exclude_from_search.”

    I have unchecked all options in Category Restriction and Category Exclusion.

    Is there some other setting that I am missing?

    I tried your debugging steps:
    1. Searching on the admin dashboard does NOT find any results
    2. I activated Query Monitor. If i try to set the “Caller,” the only Relevanssi option is “relevanssi_searching_tab().”

    Can you point me to next steps? I am not a developer, by the way.

    Thank you.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    You have a problem with your quotes. Your shortcode reads

    [searchform post_types=”post”]

    but it should be

    [searchform post_types="post"]

    Fix that, and the search works much better. (The quotes look the same with the font used here, but there’s a significant difference between these two.)

    • This reply was modified 5 years, 2 months ago by Mikko Saari.
    Thread Starter wpquizzical

    (@wpquizzical)

    Hello Mikko:

    Thank you for your reply. I made the change, but the shortcode search still yields no results. Do you have any other suggestions?

    Thank you.

    • This reply was modified 5 years, 2 months ago by wpquizzical.
    Plugin Author Mikko Saari

    (@msaari)

    It’s still wrong on the form. The form has this:

    <input type="hidden" name="post_types" value="&quot;post&quot;">

    when it should just be

    <input type="hidden" name="post_types" value="post">

    Too many quotes. It might be the copy-paste. Instead of copying the text from here, try typing it from scratch to get just regular plain quotes there.

    Thread Starter wpquizzical

    (@wpquizzical)

    Thank you Mikko. That was successful.

    I was adding the shortcode in an elementor shortcode widget, which was adding the extra quotation marks. Not sure why. I believe it did not exhibit that behavior with other shortcodes. Anyway, glad to have it resolved. Thank you for your assistance.

    Can you point to any documents for styling the search widget/input/button?

    Thanks again.

    Plugin Author Mikko Saari

    (@msaari)

    Styling the search inputs is basic CSS, there are tons of tutorials for CSS styles online.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Searching custom post type with shortcode’ is closed to new replies.