Forums

[resolved] How to have start page default to a single category? (4 posts)

  1. alittle116
    Member
    Posted 1 year ago #

    How do I make my blog start page default the first category in my categories list?

    For example, if my blog was artblog.com and the categories were Painting, Sculpture, Performance, Writing. How do I make artblog.com default to the Painting category?

    Thanks in advance.

  2. alittle116
    Member
    Posted 1 year ago #

    Ok i solved this (sort of) by including this code on the index.php file

    <?php if (is_front_page()) {
    	query_posts('cat=1');
       } ?>
       <?php if (have_posts()) : ?>
      <?php while (have_posts()) : the_post(); ?>

    However this is causing problems with the Infinite Scroll plugin. Now when I reach the bottom of the page, it reloads the same articles. It keeps looping and does not load the next page of articles.

    *The same thing happens when I disable this plugin and use normal pagination. The "previous articles" link returns the same set of articles, not the next set.

    Is there another way of achieving this that would not mess up the pagination?

    Thanks!!

  3. alchymyth
    The Sweeper
    Posted 1 year ago #

    http://codex.wordpress.org/Function_Reference/WP_Query#Pagination_Parameters

    (wp_query() and query_posts() are using the same parameters)

  4. alittle116
    Member
    Posted 1 year ago #

    Thanks but I was able to solve it with this plugin

    http://wordpress.org/extend/plugins/front-page-category/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.