Support » Fixing WordPress » Echo out featured post URL

  • Hi there,

    I’m currently working on a latest post section for the landing page on my website, and I’m having trouble echoing out the URL for the featured image attached to the post.

    Currently I’m using this:

    $args = array( 'numberposts' => 1, 'orderby' => 'post_date', 'order' => 'DESC' );
    $recent_posts = wp_get_recent_posts( $args );
    foreach( $recent_posts as $recent ) { ?>
    <div id="featuredblog">
    	<div id="featuredimage">
        	<?php the_post_thumbnail($recent->ID, 'thumbnail'); ?>
        <div id="featuredtext">
            <h1 class="h1_post_title"><?php echo $recent["post_title"]; ?></h1>
            <p class="p_post_excerpt"><?php echo $recent["post_excerpt"];?></p>
    <?php } ?>

    It doesn’t echo anything out at all. I’ve tried a number of ways that have been suggested on the forum to no avail. I’m starting to get annoyed with the entire process.

    Any help in resolving this problem would be much appreciated.

Viewing 1 replies (of 1 total)
  • Still having trouble with this.

    I’m currently looking through the functions files for the theme I’m using to make sure that the_post_thumbnail is active.

Viewing 1 replies (of 1 total)
  • The topic ‘Echo out featured post URL’ is closed to new replies.