• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Custom Posts Using ACF

This shortcode enables you to display a custom loop of posts which you can fully control using the following ACF settings :

ACF Field Settings for Genesis Custom Loop

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 :

Register for full access

Custom Fields

Reader Interactions

Comments

  1. Sue Surdam says

    June 19, 2019 at 8:17 am

    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!

    Log in to Reply
    • Brad Dalton says

      June 20, 2019 at 8:51 am

      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.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.