HomeMenu

There are so many small features built into TitaniumSites(TS) that I thought it might be helpful to start highlighting a few of them!

Today we're going to look at the

Code

[recent_posts]

shortcode.

How would you like to show previews of posts in other places on your site? Let's say you wanted to show your 4 most recent posts on your home page. It's easy enough! Here's what you'd put on your home page:

Code

[recent_posts quantity="4"]

That's all you need!

What if you want a little more control? Let's say you wanted to put each of those posts in a separate column. You can use the column shortcodes to create your columns, and then put something like the following in each one:

Code

[recent_posts quantity="1" offset="1"]

This would go in the second column. The offset attribute specifies how many recent posts to skip. So in this case we're selecting the second newest post on our site. For the first column, no offset is needed of course, and the third column would be offset="2", etc.

Other attributes that you can use are:

Code

style="list" (displays a bulleted list of the posts you request)

excerpt="full" (displays all of the content of the requested posts, instead of a partial excerpt as it does by default.)

category="name" (displays posts in a particular category. The name is the category slug, not the actual name.)

As always, use creatively! Put post previews in your sidebar, on your pages, in the footer, subheader, etc. It's up to you!


Share Your Thoughts!