Showing 3 titles for each image
-
So basically I’m trying to make a list of posts that aren’t published yet. http://streakingpirates.com/mytestpage/ her’s my result and as you can see the post titles are showing 3 times per image.
Here’s my code:
<ul> <?php echo '<ul>'; $args = array( 'post_status' => 'pending'); $recent_posts = wp_get_recent_posts ( $args ); $thumbnails = get_posts($args,'numberposts=5'); foreach ($thumbnails as $thumbnail) { echo '<li><a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">'; echo get_the_post_thumbnail($thumbnail->ID, 'thumbnail'); echo '</a></li>'; foreach( $recent_posts as $recent ){ echo '<li class="vote-title"><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a> '. $recent["the_author"].' </li>'; } } echo '</ul>'; ?> </ul>
Pretty much new to php (as of today and minor experiences which were more html related in the past) and just about getting my head around it so any help would be greatly appreciated thanks 🙂
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Showing 3 titles for each image’ is closed to new replies.