how to show different post in another page on wordpress? please help...

Discussion in 'WordPress' started by huseinbandi, Nov 10, 2011.

  1. #1
    Hey guys.. like what i said on the title. how to show different post in another page on wordpress?
    i inspire from mintees.com site..

    [​IMG]

    [​IMG]
     
    huseinbandi, Nov 10, 2011 IP
  2. benny306

    benny306 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    51
    #2
    If you want to display 1 post from different categories on the same page you could try something like this:

    <?php query_posts('cat=1,2,3,4,5,6,7,8,9&showposts=1'); ?>

    <?php while (have_posts()) : the_post(); ?>
    <?php the_title(); ?>
    <?php the_content(); ?>
    <?php endwhile;?>
     
    benny306, Nov 11, 2011 IP
  3. huseinbandi

    huseinbandi Well-Known Member

    Messages:
    1,060
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #3
    but on post1 it have to different style,size,position? and how bout code on tees page?
     
    huseinbandi, Nov 11, 2011 IP
  4. benny306

    benny306 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    51
    #4
    It looks to me like all the tees posts are from the same category though, but the post1 styled differently.

    <div id='post1'>

    <?php query_posts('cat=1&showposts=1'); ?>

    <?php while (have_posts()) : the_post(); ?>
    <h3><?php the_title(); ?></h3>
    <p class=post1content><?php the_content(); ?></p>
    <?php endwhile;?>
    </div>

    <div id='otherposts'>
    <?php query_posts('cat=1&showposts=10&offset=1'); ?>

    <?php while (have_posts()) : the_post(); ?>
    <h3><?php the_title(); ?></h3>
    <p class='otherpostsconent'><?php the_content(); ?></p>
    <?php endwhile;?>
    </div>

    Just change your stylesheet to make the post1 how you want it and otherposts how you want it.

    Perhaps someone else might have a better alternative with using only 1 loop?
     
    benny306, Nov 11, 2011 IP
  5. huseinbandi

    huseinbandi Well-Known Member

    Messages:
    1,060
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #5
    thx for your help, i'll try it! ^_^
     
    huseinbandi, Nov 13, 2011 IP
  6. huseinbandi

    huseinbandi Well-Known Member

    Messages:
    1,060
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #6
    dude, i'm using this code.. but failed.. can you correct it?

    <section class="artikel1">
    <?php query_posts('cat=1&showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <section class="date">
    <p id="day"><?php echo date('d')?></p>
    <p id="month"><?php echo date('M')?></p>
    <p id="year"><?php echo date('Y')?></p>
    </section><!-- end date -->
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <?php the_content(); ?>
    <img src="<?php echo bloginfo('template_directory'). '/img/post-image1.jpg'; ?>" alt="post-image" -->
    <?php endwhile;?>
    </li>
    </section><!-- end artikel1 -->

    <section class="artikel2">
    <?php query_posts('cat=1&showposts=1&offset=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <section class="date">
    <p id="day"><?php echo date('d')?></p>
    <p id="month"><?php echo date('M')?></p>
    <p id="year"><?php echo date('Y')?></p>
    </section><!-- end date -->
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <p>
    <?php the_content(); ?>
    </p>
    <img src="<?php echo bloginfo('template_directory'). '/img/post-image2.jpg'; ?>" alt="post-image" -->
    <?php endwhile;?>
    </section><!-- end artikel2 -->
     
    huseinbandi, Nov 21, 2011 IP