WordPress.org

Ready to get started?Download WordPress

Forums

Search in Place
[resolved] No attachment ? (11 posts)

  1. Li-An
    Member
    Posted 10 months ago #

    Is there a way to hide attachments in results ?

    http://wordpress.org/extend/plugins/search-in-place/

  2. codepeople
    Member
    Plugin Author

    Posted 10 months ago #

    Hi,

    You only should to edit the searchinplace.clss.php file (located in "/wp-content/plugins/search-in-place/php/searchinplace.clss.php") commenting the line of code number 58:

    // $posts = array_merge($wp_query->posts, $wpdb->get_results("SELECT * FROM ...

  3. Li-An
    Member
    Posted 10 months ago #

    Thank you.

  4. josjee
    Member
    Posted 5 months ago #

    I removed the complete line but this does not seem to help?
    -JosJee

  5. codepeople
    Member
    Plugin Author

    Posted 5 months ago #

    Hi,

    You should be sure to comment the line of code mentioned in the previous entry, and modify the snippet of code:

    $query->set('post_type', array('post', 'page', 'attachment'));

    like follow:

    $query->set('post_type', array('post', 'page'));

  6. adrianlittee
    Member
    Posted 4 months ago #

    Is it possible to make this a selectable option in a future iteration of the plugin so every time I update the plugin I don't have to find where to comment out?

  7. codepeople
    Member
    Plugin Author

    Posted 4 months ago #

    Hi,

    In the current version of plugin, these post_types are selected by default. I'll consider your suggestion in the next version of plugin to make these post_types optional and selectable from the settings page of plugin.

  8. Li-An
    Member
    Posted 1 month ago #

    I did the changes... and nothing is showing anymore in search results.

  9. codepeople
    Member
    Plugin Author

    Posted 1 month ago #

    Hi,

    I'll need the access to your WordPress to check the edited code.

    For send me sensitive information, use my support page in:

    http://wordpress.dwbooster.com/support

    Best regards.

  10. codepeople
    Member
    Plugin Author

    Posted 4 weeks ago #

    Hi,

    I'm sorry, after comment the line of code:

    // $posts = array_merge($wp_query->posts, $wpdb->get_results("SELECT * FROM ...

    you should paste below the snippet of code:

    $posts = $wp_query->posts;

    Best regards.

  11. Li-An
    Member
    Posted 4 weeks ago #

    OK, thank you.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.