1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Show latest article thumbnail from one category?

Discussion in 'WordPress' started by Audiomad, Apr 30, 2012.

  1. #1
    I want to show a list of new articles from one category but only have one thumbnail show from the most recent article in that list, can anyone help?

    This is the code I have so far, div id="p" is where I need the thumbnail.

    <div id="rapsbox">
    <div id="lfttxt"><div id="t-t"></div><div id="p"></div><div id="rapboxtxt">
    <?php $args = array( 'numberposts' => 9, 'category' => 7);
    	$lastposts = get_posts( $args );
    	foreach($lastposts as $post) : setup_postdata($post); ?>
    <div id="txtinr-rr"><a href="<?php the_permalink() ?>" class="blue" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></div><?php endforeach; ?>
    
    </div></div>
    Code (markup):
     
    Audiomad, Apr 30, 2012 IP
  2. janiali

    janiali Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    why don't you use this plugin wordpress.org/extend/plugins/advanced-recent-posts-widget it will do what you are looking for
     
    janiali, Apr 30, 2012 IP
  3. Audiomad

    Audiomad Peon

    Messages:
    1,028
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Plugins tend to be bulky and with the complex layout I have planned it won't work.
     
    Audiomad, Apr 30, 2012 IP
  4. raoraj

    raoraj Well-Known Member

    Messages:
    849
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #4
    if you give url or screen shot, then only we can help you out.
     
    raoraj, Apr 30, 2012 IP
  5. Audiomad

    Audiomad Peon

    Messages:
    1,028
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Why do you need a screen shot?
     
    Audiomad, May 1, 2012 IP