WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Archives Broken: shows all blog posts (2 posts)

  1. abeolson
    Member
    Posted 6 years ago #

    The Archives for my blog are not currently working. I suspect it was due to some recent changes I made in order to have Tumblr posts imported into the blog. Currently, the most recent 10 blog posts exept those in the "tumblr" category show up for anything done that invokes the archives.

    This code:

    <!-- this was added to exclude the tumblr posts-->
    		<?php $page = (get_query_var('paged'))
    		? get_query_var('paged') : 1;
    		query_posts("cat=-19&showposts=10&paged=$page");
    		?>
    		<!--end tumblr exclusion code-->

    was added to the the main index.php in order to exclude the tumblr posts from the main blog (I'm using WP-O-Matic in order to import all my Tumblr posts and have them in their own tab, details on that here).

    The full index.php can be found at http://wordpress.pastebin.ca/962141.

    The ideal functionality is a search that works correctly and searches both posts of category tumblr and regular blog posts, but I still need to exclude all posts with the tumblr category from the main blog page.

    You can see the site at http://www.abeolson.com

  2. abeolson
    Member
    Posted 6 years ago #

    Thanks to Yuchi's post on another thread, I was able to find a good way to do this.

    <?php if (is_home()) {
      query_posts($query_string . "&cat=-19");
    } ?>

    is the code I use now, and the archives and search features work.

Topic Closed

This topic has been closed to new replies.

About this Topic