Support » Themes and Templates » Display category specific posts on homepage displaying only the content

  • On the frontpage of my site I would like to display an overview of twenty of the latest posts just by showing the content of the post. The title, postdata, author info, etc can’t be displayed. Clicking through via a read more shouldn’t be possible either.

    I want to do this because I want to place category and tag specific links to other sites, so the permalink, title, number of comments etc shouldn’t be displayed.

    But I still want to be able to display a normal blogoverview under my content-only linkoverview.

    This is my theme:

Viewing 9 replies - 1 through 9 (of 9 total)
  • I am using the same technique on one of my sites :
    Only that in my theme I chose to show only THE FIRST thumb.

    it is very simple :
    You just have to remove the template tags from your Index.php (or home.php) , depends on how your theme is configured.
    For example ..

    If you do not want the author to appear, just comment the relative template tag :

    <?php the_author(); ?>

    if you do not want the category remove :

    <?php the_category(' '); ?>

    and so on…..

    do not forget to comment also the href link with the relative closing /a tag…

    Thanks for the info krembo99, but when I do that all of my frontpage posts will look like that and I actually want to display posts on my index.php that still have all the bloginfo.

    there are several way to do that ,easiest are :
    1. with a multi-loop (search )
    2. with custom fields (also search)

    you also want to show othe /n regular post with the meta data ?

    Yep that’s right, it’s a little hard to explain so I made a sketch to visualize it:

    what you showed in the sketch, will be a bit tricky, becasue first you want 20 post from a category, and then you want OTHER posts , taht some share the same category, but will not repeat the same post ….

    If you want DIFFERENT category to show above, it’s faitly easy.
    If you want the post to repeat themselves, it’s also possiable.
    You will have at any rate, to my understanding, to use multiply loops.

    Actually I don’t want the posts shown in the 20 links overview to be repeated in the normal blogoverview as well… It will be one separate category not displayed in the classic blogoverview.

    What I’ll do is do a first category specific overview with the 20 links overview category and a general news category that displays blogposts with all the postinfo.

    Edit 2: It kind of works, I assigned a category but it still displays content of other category posts as well…

    <?php if ( in_category(5) ) {
    echo ' <a href="<?php the_permalink() ?>"><?php the_title() ?></a> ';
    } else {

    This is how my index.php looks like atm:

    <?php get_header(); ?>
    <div id="wp_content">
    <div id="post_entry">
    <h3>20 Links</h3>
    <div class="post_content"><?php $recent = new WP_Query("category_name=Video Game Deals&showposts=20"); while($recent->have_posts()) : $recent->the_post();?>
                <?php the_content(__('Read the story &raquo;'));?><div style="clear:both;"></div>
    <?php endwhile; ?></div>
    <b><?php if ( in_category('8') ): ?><?php while (have_posts()) : the_post(); ?> <!-- init post page --></b>
    <div class="post_meta" id="post-<?php the_ID(); ?>">

    After the link overview come the normal blogposts in category 8, but they don’t get displayed…

    Alright it kind of works how I wanted now, just the archive pages now.

    Thanks for all the help krembo99!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Display category specific posts on homepage displaying only the content’ is closed to new replies.