WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Global Search
[resolved] return all blogs pages, posts and maybe even custom post types (5 posts)

  1. publicradio
    Member
    Posted 3 years ago #

    Hello,

    I would like to remove these other options to search across only blogs where I'm a member, pages v posts, etc, and just have a search across all blogs, all content types (including a custom post type 'documents' if possible).

    I'm fine hacking up the plugin if I need to. I'm fine changing form elements to hidden ones, which I've already done in fact. The biggest thing hanging me up right now is how to return both pages and posts.

    Any help would be much appreciated, thanks.

  2. sgelbart
    Member
    Posted 2 years ago #

    You can do it, if anyone's has this problem post here and I'll post a solution...sorry being lazy right now :)

  3. geekinesis
    Member
    Posted 2 years ago #

    Hi
    If you have a solution to search custom post types I would be grateful to hear it

    Thanks

  4. sgelbart
    Member
    Posted 2 years ago #

    go to the plugin editor, open the shortcodes.php file and find the ms_global_search_page function. There I changed my $post_type variable line to look like the following:

    $post_type = "( post_type = 'post' OR post_type = 'page' OR post_type = 'custom_post_type1' OR post_type = 'custom_post_type2')";

    where custom_post_type1 and custom_post_type2 are my custom post types.

  5. geekinesis
    Member
    Posted 2 years ago #

    That's great thank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic