• Resolved sjrkar

    (@sjrkar)


    The site I’m currently developing is located at https://testdrews.stanragets.com/?page_id=507

    Here is the problem I’m running into. I’m using a plugin called catablog that takes in a spreadsheet and turns each entry into a custom post. I have successfully built a custom search query for the dropdown menus of the search box to look at the categories and the meta_values that catablog stores. The search box itself works for searching meta_values.

    My problem is that I cannot get the search to query the title and descriptions of the posts! It’s driving me absolutely crazy.

    Here is the actual search query I am using.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Can anyone give me some insight as to what I need to do to search the titles and descriptions. I’ve been searching online for days, trying everything I can think of, and still can’t get it to work. Any thoughts/help would be most appreciated!

Viewing 1 replies (of 1 total)
  • Thread Starter sjrkar

    (@sjrkar)

    Ok. This is an update. Here’s what I have thus far.
    [Code moderated as per the Forum Rules. Please use the pastebin]

    The code above works to sort based on the three dropdown boxes. It also works to search the meta data based on keyword.

    The “firstquery” object works to search the database for title/description.

    Both queries work great on their own, but I cannot make them play nice together. Does anyone have any ideas?

    I’ve tried array_merge() but perhaps I’m not using it properly. The line that contains “have_posts()” on it returns an error saying that there is no object when I merge the arrays. Is there something else that I can do to make these two searches work together?

    I’ve even toyed with the idea of somehow running one, then using an if statement to see if the other returns posts and then running it too, but could easily lead to duplicate listings. I’m really at a loss as to what to do right now.

Viewing 1 replies (of 1 total)
  • The topic ‘Need Help Searching Title And Description in Custom Search Using WP_Query’ is closed to new replies.