Recent Posts Without Shortcode [resolved]
-
Hi guys, I’m having trouble showing the shortcode for recent posts on my home page after I entered in code to get my recent blog posts to show up on my home page.
Here is the code I used for recent posts:
$args = array( 'numberposts' => 3 ); $lastposts = get_posts( $args ); foreach($lastposts as $post) : setup_postdata($post); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_content(); ?> <?php endforeach; ?>
I saw in another topic how to get 10 recent topics on your home page with shortcode, but it didn’t work after the above code. Could someone please help me with the code to get 10 recent topics to appear on my home page?
Using the current versions of wordpress, bbpress and buddypress. Working with a buddypress default child theme. I’m also newer to php, so go easy please 🙂
- You must be logged in to reply to this topic.