WordPress.org

Forums

[resolved] Show one post on Home page? (9 posts)

  1. indiaberry
    Member
    Posted 7 years ago #

    I have noticed that when I set Custom Query String to show one post on the home, and 10 posts on the category, it showed 10 posts on the category. How do I fix that problem so that I can show only one post on the home page, which is an index.php file?

  2. moshu
    Member
    Posted 7 years ago #

    What is the problem?
    You said it is set to:
    - 1 post on home
    - 10 posts on category archives

    Result = it shows 10 posts on category archives, according to you.

    What is there to be fixed?
    Also: which version of the plugin? There are several versions of it, depending on your WP version.

  3. indiaberry
    Member
    Posted 7 years ago #

    The version of the plugin is 2.7. I also tired 2.8 and 3.0.

    I set it to show one post on the home page, but on the home page, it is showing 10 posts. When I change the number of posts to show on the category, the home page (index.php) showed the same number of posts as the category.

  4. moshu
    Member
    Posted 7 years ago #

    Possible troubles:
    your index.php has a custom Loop in it
    you are using the wrong combo of WP & CQS
    another plugin interferes with CQS

  5. indiaberry
    Member
    Posted 7 years ago #

    I have noticed that neither of the 2.7, 2.8 or 3.0 version of CQS worked when all the other plugins were disabled.
    It is probably the index.php had a custom loop in it. How do I fix the custom loop to make it work with CQS?

  6. indiaberry
    Member
    Posted 7 years ago #

    I found the source of the problem. When the $cat= is in place, the CQS don't work for the homepage. I want to be able to eliminate some categories from my home page. How do I do that?

    <?php
    $cat="1, 3, 4, 7, 8, 11, 12";
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    ?>

  7. moshu
    Member
    Posted 7 years ago #

    Use a plugin that exclude certain categories from showing up on the homepage. You should never touch that "short and sweet" index!

  8. Asuka_Aki
    Member
    Posted 6 years ago #

    I sed this line of code in the index, instead of get header line to show only one post home page but have 10 in categories and archives.

    <?php get_header(); query_posts('posts_per_page=1'); ?>

    To exclude categories from the home page, I use this code:

    <?php
    wp_list_categories('orderby=name&exclude=10'); ?>

  9. johntblogger
    Member
    Posted 6 years ago #

    I'm trying to create a CMS web site. I've watched a tutorial video, but that was made on a different version than the one I have. I have ver. 2.6.2 Can you tell me were to find the (page slug and include page in navigation?)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.