This download provides the code which enables you to display one or more entries from any post type, taxonomy and term in any Genesis hook position.
By default, the code for the 2nd method uses the genesis_after_loop hook to display a featured post from the portfolio CPT after the loop on the front page. It also displays the entry like a full width block as seen in this screenshot taken from the demo installation used to test the code.
The download folder includes 2 code snippets to display your posts.
The 1st code snippet includes the default hooks and markup to display the post according to your Genesis > Theme Settings > Content Archive settings.
The 2nd code snippet uses a new loop with custom markup to display your entries as seen in the above demo image and following demo video :
Shows a checkbox added to the single post edit screen enabling users to select posts to display in a custom loop, using 2 different methods with different output, on the front page or any other page in any Genesis hook position. In this case, the genesis_after_loop position.
Tested using the Genesis Sample child theme by StudioPress however will work in any Genesis child theme.
There’s 2 steps :
- # Upload the file named featured-meta-box.php to your child theme folder like this
- # Copy and paste the PHP code from the functions.php file to the end of your child themes functions file. Choose one method of output only. Either the function named custom_featured_post_loop if you want to output your entries using the default genesis markup and hooks or the code which uses the new_wp_featured_posts_block function if you want to add your own HTML markup and/or display your featured posts full width as seen in the demo video.
The download folder also includes code to create a custom post type named and custom taxonomy types.