This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'genesis_entry_footer', 'tj_subpage_navigation' ); | |
/** | |
* Adds page links to the descendants of page ID 6. | |
* | |
*/ | |
function tj_subpage_navigation() { | |
//* Return early if not on a page or if on the front page | |
if ( ! is_page() || is_front_page() ) | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'template_include', 'your_custom_cpt_template', 99 ); | |
/** | |
* Load an alternative template file for a given post type | |
* | |
* @param string $template path to the default template | |
* @return string $template path to the default template | |
* @return string $custom_template path to the custom template | |
*/ | |
function your_custom_cpt_template( $template ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_login', 'fj_infusionsoft_api_sample_usage', 10, 2 ); | |
/** | |
* Adds a user as an Infusionsoft contact after they log in to WordPress. | |
* | |
* @param string $user_login WP user login | |
* @param object $user WP user object | |
*/ | |
function fj_infusionsoft_api_sample_usage( $user_login, $user ) { | |
// Instantiates the Infusionsoft object and ensures that we have a valid access token. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Retrieves all post meta data according to the structure in the $config | |
* array. | |
* | |
* Provides a convenient and more performant alternative to ACF's | |
* `get_field()`. | |
* | |
* This function is especially useful when working with ACF repeater fields and | |
* flexible content layouts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Make sure to prefix the function if you do not use a namespace. | |
// namespace TimJensen\HelperFunctions; | |
/** | |
* Returns an auto generated post excerpt, or a manual excerpt if one has been set. | |
* | |
* @version 1.2.1 | |
* | |
* @param int $post_id Required. Post ID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$config = array( | |
array( | |
'name' => 'prefix_subtitle', | |
), | |
array( | |
'name' => 'prefix_content_row', | |
'sub_fields' => array( | |
array( | |
'name' => 'css_classes', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
array( | |
'prefix_subtitle' => 'This is the subtitle', | |
'prefix_content_row' => array( | |
array( | |
'css_classes' => 'extra-class row-1', | |
'background_color' => '1', | |
'columns' => array( | |
array( | |
'column' => 'Row 1 column 1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Prefixing is recommended if you are not using a namespace. | |
// namespace TimJensen\GenesisStarter\Setup; | |
/** | |
* Adds hooks immediately before and after Genesis structural wraps. | |
* | |
* @version 1.1.0 | |
* | |
* @return void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'before_genesis_site-inner_wrap', 'do_full_width_page_header' ); | |
/** | |
* Adds a div with a background image before the site-inner wrap. | |
*/ | |
function do_full_width_page_header() { | |
printf( '<div class="full-width-page-header" style="background: url(\'%s\');"></div>', | |
wp_get_attachment_image_url( 2623, 'full' ) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enforce anti-spam honeypot on all Gravity forms. | |
* | |
* @param array $form | |
* | |
* @return array $form | |
*/ | |
add_filter( 'gform_form_post_get_meta', function ( $form ) { | |