WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] My Posts Have Disappeared (3 posts)

  1. bbx
    Member
    Posted 7 years ago #

    Hello everyone.

    First of all, thx for all the support. It's one of the (many) reasons why I've chosen WP instead of another.

    I've been using WP for a couple of months.

    I'm now starting a new project and that's why I'm working locally (using XAMPP Lite).

    Everything was fine, managed to create my own template, try some posts, make them appear on the index page.
    Alright.

    I wanted to add some categories (and sub categories). So I added some. But when I went back on the home page, all my posts had gone! Only my posts (not my sidebar or anything generated dynamically).
    So I went on the admin panel to see if they had gone, but they were still in the admin panel.

    I'm wondering if it's a DataBase problem, but I don't think so, they're still there but can't display.

    I didn't change the index.php file when I created categories.

    What can it be? Seems so weird.

    Thx for any help or suggestion.

    boomy bx

    EDIT: I forgot to tell you the most important. I actually changed the index.php in order to display only 1 category. I change this file before adding categories.

    In order to achieve this (I tried it by myself and that may be the problem), I added:
    <?php if (in_category('1')) { ?>
    before the Loop, and added
    <?php } ?>
    right after the Loop.
    It worked (before I added Categories).

  2. MichaelH
    Member
    Posted 7 years ago #

    That <?php if (in_category('1')) { ?> code should be inside the loop, not outside it.

    Excluding posts form a certain category has an example.
    http://codex.wordpress.org/The_Loop#Exclude_Posts_From_Some_Category

  3. bbx
    Member
    Posted 7 years ago #

    Thx it works now!

Topic Closed

This topic has been closed to new replies.

About this Topic