Support » Plugins and Hacks » WP_Query – Search by post_title

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Forum Moderator

    Uh? Why use WP_Query?

    why not?

    The reason I’m using WP_query is because I am searching a custom_post_type and searching post_meta and a custom taxomony also. WP_Query can do all that except post name.

    The way I’ve done this in the past is to create a function hook attached to save_post that saves the title and content as hidden custom fields. Then you can just search the custom fields since WP_Query can’t (to my knowledge…) search the title and content directly.

    Seems like there should be a less hacky way though.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP_Query – Search by post_title’ is closed to new replies.