• hello, how can i make the loop so that on the index page it will display only page title for some post with same category and for other category it show full post as reguler.

    thank you

Viewing 1 replies (of 1 total)
  • Look in wp-content/themes/THEME_NAME/index.php. This file contains the basic layout for your index page. The portion of the code we’re interested is-

    <div class="storycontent">
    <?php the_content(__('(more...)')); ?>
    </div>

    This is the portion that actually spits out the full contents. Let’s put a conditional around this. Let’s say if we want to show the full contents for only those posts in category 6-

    <div class="storycontent">
    <?php
    if (in_category("6")) {
      the_content(__('(more...)'));
    }
    ?>
    </div>

    In this fashion, you can change the condition any way you want. Good luck!

    [signature moderated Please read the Forum Rules]

Viewing 1 replies (of 1 total)
  • The topic ‘show only post title for some category and show full content for other’ is closed to new replies.