Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter davamb

    (@davamb)

    We’re using Builder, by iThemes. It’s highly customized and includes a number of custom templates too.

    These template pages are coming up in the results (with only the placeholder text) which is one of the reasons we want to prevent pages coming up in the search results…but regular WP pages are coming up too.

    Does this mean your plugin won’t work for us?

    Thank you for taking the time on this.
    Best wishes,
    David

    Thread Starter davamb

    (@davamb)

    Hey Petra,

    Sorry it took me a few days to test this.

    “search_sql_query” exists several times in the function. Which one should be changed?

    It seems to me that the third and final instance is the one you say I should change – but it doesn’t stop pages coming up in the results.

    I replaced:
    $search_sql_query .= ')';
    with:
    $search_sql_query .= ") AND $wpdb->posts.post_type <> 'page' ";

    Did I change the wrong line, or could it be something else?

    Thanks,
    David

    Thread Starter davamb

    (@davamb)

    Thanks genovic and Petra – the problem with this (for us) is that we would have to remember to add the page ID of every new page we add. It seems that having the option of excluding ALL pages globally would be more useful.

    In our case, we only want to search posts, not pages.

    Thanks,
    David

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