Hi,
I can’t seem to find much on this, it may be the way I am wording the question.
i would like to create a section of content on the home page with columns in it. - let’s say 3.
I would like to display the latest three posts of news in these three columns.
what is the best way to go about this?
Im still a novice with coding, and I don’t have a full grasp of php, although I am studying it, so Im struggling as I don’t quite know where to start on this one.
I achieved it on a theme I built from the ground up with the help of a tutorial but don’t know which bits of php are relevant, I really want to be understanding what I am doing at this point.
if there are any links anyone could point me to on this topic I would be grateful!
There is nothing Roots specific to this. You can create a template for this (e.g. templates/recents.php) and include it in your front-page.php using
<?php get_template_part('templates/recents'); ?>
or even create a shortcode in a functionality plugin and include the shortcode in your edit screen. Note, the code for the shortcode would greatly differ. link
@enollo thats similar to what is in my other site. thank you for explaining, that makes sense to me mostly. except if I were to put this in my home page template, what is this bit of code doing?
<?php get_template_part('templates/recents'); ?>
is it bringing another page template into my page template?
@enollo was proposing you create a template part with the recents code and then reference that template part instead of adding the code directly to your home template.