This shortcode enables you to display a custom loop of posts which you can fully control using the following ACF settings :
The settings enable you to control :
Post type – Dynamically lists post types from theme & plugins.
Category – Select 1 or more categories
Tag – Select 1 or more tags
Number of Posts – Choose how many posts
Offset – Offset posts by any number
Orderby – Order by Ascending or descending
Entry title – Show the entry title
Unlink Entry title – Remove the a href from all entry titles.
Featured image – Show the featured image
Image alignment – Align the featured image left right or none.
Image size – Choose the image size from all available sizes dynamically generated.
Post info – Display the default post info shortcodes or your custom selection of shortcodes.
Entry meta – Display the default entry footer shortcodes or your custom selection of shortcodes.
Entry content – Display the full entry content, excerpt or content limit.
Entry Margin – Add margin to each .entry div in the loop
Entry Content Margin – Add margin to the .entry-content div.
Read more text – Customize the read more text.
Demo Video #
Shows how you can use ACF settings to display, remove or modify every element in a custom loop of specific posts.
Tested using the latest version of Genesis and the Genesis Sample child theme by StudioPress.
Installation – Support Included #
There’s 4 steps :
Step 1 – Upload the file named custom_posts.php to your child themes root directory.
Step 2 – Add the following line of PHP code to the end of your child themes functions.php file :
Wow! This is great. I have been using a Genesis premium plugin for this, however, ACF is useful for so much more and this is so nice for a page by page basis.
The bomb would be if it could be used in a widget so pages could be built with sections pulling different categories or post types.
Thanks for the awesome code – You’re the best!
Hello Sue. If that can be done, i will publish another tutorial. Waiting for a reply back from ACF about location rules for widget areas.
Update : You can use ACF Pro to target blocks.