• Hi!
    I have noticed that the search results, using Twenty Thirteen theme on WP 3.7.1 shows posts and pages content.
    I want to show only posts after searching for a keyword but i cannot manage.
    I have tried to find solutions on google and WP forums but i found very old solution which didnt even work. Also, this latest version of WP has a different search.php …

    I have tried also adding this code before the loop, in search.php:

    <div id="content" class="site-content" role="main">
    		<?php query_posts('post_type=post'); ?>
    		<?php if ( have_posts() ) : ?>

    The query filters only posts, but it forgets the keywords and in the end, it shows all the posts.

    Does anyone know something about this? Can anyone help?
    thank you for your time.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Wp 3.7 Search results only for posts (not pages)’ is closed to new replies.