Unlock your potential with a Pro Membership
Here is where you propel your career forward. Come join us today. Learn more.
Entry Content – Post Content Navigation
Lab: The Loop Part 2 – Developer’s Guide to Customizing Genesis
Video Runtime: 13:31
In this episode, you’ll take a look at the Genesis framework function genesis_do_post_content_nav
, which is found in genesis/lib/structure/post.php
. This function is setting up the arguments which are passed into the WordPress Core function wp_link_pages
. The intent of this function is handle in post navigation, i.e. paginated posts. Did you know that functionality even exists?
I’m also introducing you to a PHP construct called str_replace()
which allows you to swap out parts of a string by searching for a given pattern. As part of your customization hands-on work in this lab, you’ll be replacing the “Pages:” string, which is hardcoded in Genesis. You’ll need to use str_replace()
or some like functionality to do this customization as this content is not filtered, meaning it is not passing through a filter event.
I do note in this episode that another strategy which StudioPress could do is to move these hardcoded literals, such as __( 'Pages:', 'genesis' )
into a configuration file as part of a “configuration architecture.”
-
Customized code sample
Your best friend is code, Tonya is making the introductions.
Episodes
Total Lab Runtime: 02:28:53
- 1 Before Entry Content Hook - genesis_before_entry_contentpro 07:13
- 2 Entry Content Overviewpro 05:49
- 3 Entry Content - Post Imagepro 10:43
- 4 Real Refactoring Examplefree 10:46
- 5 Entry Content - Post Contentpro 12:16
- 6 Entry Content - Post Content Navigationpro 13:31
- 7 Entry Content - Post Permalinkpro 09:35
- 8 After Entry Contentpro 04:16
- 9 Entry Footer - Overviewpro 07:14
- 10 Entry Footer - Post Metapro 14:07
- 11 After Entry - Overviewpro 06:01
- 12 Reorder Author Box & After Entry Widget Areafree 08:25
- 13 After Entry Widget Areapro 11:30
- 14 Turning on the Adjacent Entry Nav - Previous and Nextpro 10:09
- 15 Customize the Previous and Nextpro 06:25
- 16 After the Loop - Archive Posts Navigationpro 07:26
- 17 The Loop Else - No Posts Foundpro 01:31
- 18 Wrap it Upfree 01:56