So, I'm taking my first shot at creating my own custom Wordpress theme with Underscores. I have everything straightened out, with the exception of one last thing I want to add.
I would like to add a latest/recent posts section to my front page. I know there's a lot of answers out there on how to do this, but I need to do it differently.
I noticed that the most common way is to create a static page template for the front page and and insert your own php code. This is the way everyone seems to suggest when someone asks. However, this won't work for me because of the way that I designed the site for the editors. The front page needs to be editable, so telling anyone to open up a php file and shift stuff around won't cut it. Instead, I've set it up so all front page can be changed through "edit page" in the admin panel. I have also created shortcodes for specific modules that allows the user to reflow the page without breaking the site. I want to do this same thing for recent posts, with a twist.
I came across a plugin called "display-posts" which seems to do what I describe, but not perfectly. This plugin creates a shortcode that shows any posts you want where you insert [display-posts]. What I don't like about this plugin is how it inserts the post using its own HTML fomatting, and not the same code that is in the template's content.php.
I styled the post layout in content.php to be exactly as I want it to display on the blog page. I would like this same layout to be called in a shortcode on a static page where I want to display the recent posts. Essentially, I think want a shortcode that returns the main loop in index.php (which in turn does get_template_part), but limits to 3 posts.
I looking for others who wanted to do what I described, but I only came across about two people asking for something similar, and no solution. I made a brief attempt at creating my own shortcode but it only had the effect of looping the content of the static page itself, not the latest posts.
If anyone could help, it would be greatly appreciated. Since this is my first WordPress theme, I'm still a novice, and I don't have a ton of php experience as well. Enough to get by with basic things, but not enough to figure this out on my own.