Trying To Edit A "Related Posts" Style Heading On Blog

Discussion in 'WordPress' started by bad_bob00, Jun 25, 2012.

  1. #1
    Hey guys,

    Looking for some help. On my wordpress blog which is running a London Live theme, at the bottom on the homepage it is showing "Other_news.php" which is a heading (Other News) which displays old blog posts.
    My problem is that its showing very old posts - 3 years or so, and I don't know how to change this. I think its setup to display posts from specific categories but I'm not sure how to edit these. Would really appreciate any help!

    I can paste the contents of Other_news.php below if it will help...
    You can take a look at the site here, its on the homepage at the bottom just before the footer: http://www.footyblog.net


    Thanks.
    Matt
     
    bad_bob00, Jun 25, 2012 IP
  2. Imposter

    Imposter Peon

    Messages:
    169
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well, I doubt that anyone of us has a crystal ball... :)
     
    Imposter, Jun 25, 2012 IP
  3. bad_bob00

    bad_bob00 Active Member

    Messages:
    3,472
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #3
    haha fair enough! here it is:

     
    bad_bob00, Jun 26, 2012 IP
  4. Imposter

    Imposter Peon

    Messages:
    169
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Imposter, Jun 26, 2012 IP
  5. bad_bob00

    bad_bob00 Active Member

    Messages:
    3,472
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #5
    Thanks Imposter, was wondering if someone could help again...

    If I want to display posts from the previous 30 days, this is apparently the code:

    How do I go about adding it to this line:
    Wouldn't know how/where to add it...


    Thanks again
     
    bad_bob00, Jun 29, 2012 IP
  6. Imposter

    Imposter Peon

    Messages:
    169
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Try this:

    <?php $featured = new WP_Query('showposts=6&orderby=rand&monthnum=' . date('n', current_time('timestamp')));  while($featured ->have_posts()) : $featured->the_post();  ?>
    PHP:
    That should display posts published in the last month in a random order.
     
    Imposter, Jun 29, 2012 IP
    bad_bob00 likes this.
  7. bad_bob00

    bad_bob00 Active Member

    Messages:
    3,472
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #7
    Thanks Imposter, I've tried this code but it doesn't seem to change anything - its still showing posts from a few years ago.

    I don't know about the code but is the fullstop needed before:
    date('n', ....
     
    bad_bob00, Jul 1, 2012 IP
  8. Imposter

    Imposter Peon

    Messages:
    169
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    That's weird, I tried to put it in my theme and it worked for me.

    Yes. The full stop must be there to connect the string with the returned value of the date() function.
     
    Imposter, Jul 1, 2012 IP
  9. bad_bob00

    bad_bob00 Active Member

    Messages:
    3,472
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #9
    Ah okay.. well thanks for giving it a go. I was hoping there would just be an option somewhere within my theme but I can't seem to find anything
     
    bad_bob00, Jul 2, 2012 IP