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 //* Mind this opening PHP tag | |
/** | |
* This snippet will take a custom field and add its data to a shortcode. | |
* In this example, we are adding a few WooCommerce products before the content of a Genesis theme. | |
* The code is taking the product IDs entered in the home page's edit panel and dynamically inserting | |
* them into a WooCommerce shortcode, which then outputs the products with those IDs. | |
* | |
* Read more about this example and the process of adding custom fields into shortcodes at EngageWP.com | |
* http://www.engagewp.com/how-to-insert-custom-fields-into-shortcodes |
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 //* Mind this opening php tag | |
/** | |
* EngageWP.com | |
* Remove content excerpt from custom post type archive in Genesis | |
*/ | |
//* Grab the content for each custom post type | |
add_action( 'genesis_before_loop', 'rv_cpt_excerpts' ); | |
function rv_cpt_excerpts() { |
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 //* Mind this opening php tag | |
/** | |
* This will hide the Divi "Project" post type. | |
* Thanks to georgiee (https://gist.github.com/EngageWP/062edef103469b1177bc#gistcomment-1801080) for his improved solution. | |
*/ | |
add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 ); | |
function mytheme_et_project_posttype_args( $args ) { | |
return array_merge( $args, array( | |
'public' => false, |
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 //* Mind this opening php tag | |
//* Remove Post Info, Post Meta from CPT | |
add_action ( 'get_header', 'rv_cpt_remove_post_info_genesis' ); | |
function rv_cpt_remove_post_info_genesis() { | |
if ( 'post' !== get_post_type() ) { | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
} | |
} |
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 //* mind this opening php tag | |
//* Exclude categories from blog page | |
add_filter('pre_get_posts', 'rv_exclude_blog_categories'); | |
function rv_exclude_blog_categories($query) { | |
if ($query->is_home) { | |
$query->set('cat', '-1,-2,-3'); //Replace with your category numbers (keep negative signs) | |
} | |
return $query; | |
} |
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 //* mind this opening php tag | |
/** | |
* Snippet provided by MemberPress support and modified by Ren Ventura | |
**/ | |
//* Kick admins out from MemberPress login form | |
add_filter( 'mepr-validate-login', 'kick_out_admins' ); | |
function kick_out_admins( $errors ) { | |
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 //* mind this opening php tag | |
//* Make Admin Comments Become Author Comments | |
add_filter( 'preprocess_comment', 'rv_admin_comments_to_author_comments' ); | |
function rv_admin_comments_to_author_comments( $comment_data ) { | |
if ( $comment_data['user_ID'] == 1 ) { // Change 1 to your admin ID | |
$comment_data['user_ID'] = 8; // Change 8 to your Author ID | |
$comment_data['comment_author'] = 'Your Name'; // Enter the name you want to appear in comments |
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 //* mind this opening php tag | |
/** | |
* Display Last Updated date if a post has been updated (Genesis Framework) | |
*/ | |
add_filter( 'genesis_post_info', 'rv_post_info_filter' ); | |
function rv_post_info_filter( $post_info ) { | |
global $post; |
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 //* mind this opening php tag | |
/** | |
* This snippet returns a list of all currently hooked functions. | |
* It is set up to output this data on a specific page. Do not output this data publicly. | |
* Use this snippet for debugging/testing/development. | |
* Source: http://www.rarst.net/wordpress/debug-wordpress-hooks/ | |
* Modified by Ren Ventura, EngageWP.com | |
**/ |
OlderNewer