1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to not show all new posts on front page?

Discussion in 'Blogging' started by makingfastcash22, Mar 24, 2009.

  1. makingfastcash22

    makingfastcash22 Senior Member

    Joined:
    Feb 15, 2009
    Messages:
    1,152
    Likes Received:
    178
    Home Page:
    I am trying to have a category page called videos and I just want to show one post with a video on the top of the front page and then regular post. I still want it to show all new video posts when I click on the category link.

    How can I do this?

    Thanks
     
  2. trapmuzik

    trapmuzik Junior Member

    Joined:
    Mar 20, 2009
    Messages:
    192
    Likes Received:
    22
    so are you saying that you want one post from category video at the top of the front page and then the newest posts following that on the same page?
     
  3. *zap*

    *zap* Regular Member

    Joined:
    Apr 7, 2008
    Messages:
    349
    Likes Received:
    98
    Occupation:
    none
    Location:
    Uk
    A shot in the dark as you failed to say where or with what software
    WP-Sticky plugin
     
  4. makingfastcash22

    makingfastcash22 Senior Member

    Joined:
    Feb 15, 2009
    Messages:
    1,152
    Likes Received:
    178
    Home Page:
    yes one post from the video category on front pagee (this can be replaced by a new video, but judt one video on the front page.But I want the newest post from all other categories on the frontpage and all additional new videos to only show on the category video page.
     
  5. trapmuzik

    trapmuzik Junior Member

    Joined:
    Mar 20, 2009
    Messages:
    192
    Likes Received:
    22
    here try this on your front page

    Code:
    <?php $my_query = new WP_Query('category_name=videos&showposts=1');
      while ($my_query->have_posts()) : $my_query->the_post();
          <!-- Do post related stuff here -->
      <?php endwhile; ?>
        <!-- now show all posts -->
      <?php if (have_posts()) : while (have_posts()) : the_post(); 
         <!-- Do stuff... -->
      <?php endwhile; endif; ?>
    
    
    
    
     
  6. makingfastcash22

    makingfastcash22 Senior Member

    Joined:
    Feb 15, 2009
    Messages:
    1,152
    Likes Received:
    178
    Home Page:
    Thanks


    I will give it a shot.


    This goes on the template index page,correct?
     
  7. trapmuzik

    trapmuzik Junior Member

    Joined:
    Mar 20, 2009
    Messages:
    192
    Likes Received:
    22
    yes this goes in the index.php code. note that this code will still show any video category posts in the second loop unless you exclude them in the loop
     
  8. karbin

    karbin Newbie

    Joined:
    Feb 25, 2009
    Messages:
    10
    Likes Received:
    3
    You could also try an rss feed at the top that just shows one post from the video category stream
     
  9. K1w12k3

    K1w12k3 Junior Member

    Joined:
    Feb 13, 2009
    Messages:
    116
    Likes Received:
    393
    Home Page:
    Alternatively, create a new page with the code above and set WP to use that page as your homepage. That way you don't need to change your index.php