• Hello, thanks for this wonderful application. I’m relatively new to WP, but I’ve managed to create a site that works OK for my use.

    I’m using different .php-pages for showing different categories, using a
    <?php if ( in_category(‘numberofcategory’) ) { ?>
    in the loop on each page. See below.

    Now I’m struggling with that suddenly posts will be disappearing from these pages, forcing me to edit the posts and re-publish them. What can be causing this?
    Also, I noticed that posting posts with other users than admin can cause earlier posts to disappear as well..
    Any ideas?
    Thanks!


    <!-- Start the Loop. -->
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <!-- The following tests if the current post is in category 9. -->
    <?php if ( in_category('2') ) { ?>
    <h3><?php the_title(); ?></h3>

    <!-- Display the Post's Content in a div box. -->
    <div class="entry">
    <?php the_content(); ?>
    </div>

    <?php } else { ?>
    <div class="post">
    <?php } ?>

    <!-- Stop The Loop (but note the "else:" - see next line). -->
    <?php endwhile; else: ?>

    <!-- The very first "if" tested to see if there were any Posts to -->
    <!-- display. This "else" part tells what do if there weren't any. -->
    Sorry, no posts matched your criteria.

    <!-- REALLY stop The Loop. -->
    <?php endif; ?>

    My page: http://www.stasunniva.com
    Best regards,
    Eyvind Ljungquist

Viewing 1 replies (of 1 total)
  • Thread Starter strul

    (@strul)

    Of course, nevermind the comment-line before the categories-tag: <!– The following tests if the current post is in category 9. –> I haven’t bothered changing it. The categories tag should be correct 🙂
    -sTRuL

Viewing 1 replies (of 1 total)
  • The topic ‘Posts disappear – need republishing to show’ is closed to new replies.