Displaying all posts as thumbnails
-
I apologize if this is covered somewhere but I couldn’t seem to find anything I could understand, I have total entry level php skills.
I’m making a portfolio site and the pieces are entered as posts, so I wanted a constant footer on each page that displays every post as a thumbnail + title in a grid (not a slider). Is there a widget for this I could use, or some php function I could add to the footer?
Think this was close but wasn’t sure how to implement it: https://stackoverflow.com/questions/6184385/how-to-show-all-of-my-posts-with-thumbnail-with-title-on-a-single-page-in-wordpr :
<?php $args = array( 'numberposts' => -1 ); // optionally put more arguments here // see wordpress function reference, 'get_posts' // -1 for number of posts displays all $postlist = get_posts($args); foreach ($postlist as $post) { setup_postdata($post); if (has_post_thumbnail()) { echo '<h2><a href="'; the_permalink(); echo '">'; the_title(); echo '</a></h2>'; the_post_thumbnail(); // alter markup and style accordingly // optionally add thumbnail class as function parameter // as previously defined in functions.php } } ?>
I’m using the roots.io bootstrap framework.
any help would be GREATLY appreciated!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Displaying all posts as thumbnails’ is closed to new replies.