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
/** Modify the speak your mind text based on post type*/ | |
add_filter( 'genesis_comment_form_args', 'custom_comment_form_args' ); | |
function custom_comment_form_args($args) { | |
if ( 'recipe' == get_post_type() ) { | |
$args['title_reply'] = 'Tell Us About The Meal!'; | |
return $args; | |
} | |
else { | |
$args['title_reply'] = 'Leave a comment'; | |
return $args; |
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 | |
// all of the various add/remove functions | |
add_filter( 'genesis_comment_form_args', 'custom_cpt_comment_form_args' ); | |
remove_action('genesis_post_title', 'genesis_do_post_title'); | |
// custom functions start here | |
function custom_cpt_comment_form_args($args) { | |
$args['title_reply'] = 'Blog Me!'; | |
return $args; | |
} |
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
add_action( 'pre_get_posts', 'change_number_of_posts_home' ); | |
function change_number_of_posts_home( $query ) { | |
global $wp_the_query; | |
if( $query->is_main_query() && is_home() ) { | |
$query->set( 'posts_per_page', '15' ); | |
} | |
} |
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
/** Force full width layout */ | |
add_filter( 'genesis_pre_get_option_site_layout', 'child_do_layout' ); | |
function child_do_layout( $opt ) { | |
$opt = 'full-width-content'; // You can change this to any Genesis layout | |
return $opt; | |
} | |
/** Other options include: | |
* content-sidebar | |
* sidebar-content |
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 | |
// Register newsletter widget area | |
genesis_register_sidebar( array( | |
'id' => 'newsletter', | |
'name' => __( 'Newsletter', 'custom-theme' ), | |
'description' => __( 'This is the newsletter section.', 'custom-theme' ), | |
) ); | |
// Add the newsletter widget after the post content |
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
//the below is correct | |
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); | |
// below is not correct | |
remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ ); | |
// the difference is the "fancy quotes", they aren't true single-quotes so PHP will ignore them. |
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
/** Unregister site layouts */ | |
genesis_unregister_layout( 'sidebar-content' ); | |
genesis_unregister_layout( 'full-width' ); | |
genesis_unregister_layout( 'content-sidebar-sidebar' ); | |
genesis_unregister_layout( 'sidebar-sidebar-content' ); | |
genesis_unregister_layout( 'sidebar-content-sidebar' ); |
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 | |
function fb_home_image( $tags ) { | |
if ( is_home() ) { | |
$latest_post = get_posts("post_type=post&numberposts=1"); | |
$latest_post = $latest_cpt[0]->ID; | |
if ( class_exists( 'Jetpack_PostImages' ) ) { | |
$post_images = Jetpack_PostImages::get_images( $latest_post, array( 'width' => 200, 'height' => 200 ) ); | |
if ( $post_images && !is_wp_error( $post_images ) ) { | |
$image = array(); |
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('init', 'kraft_woo_publicize'); | |
function kraft_woo_publicize() { | |
add_post_type_support( 'product', 'publicize' ); | |
} |
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 | |
/* | |
* Plugin Name: Custom Facebook Admin Meta Tag | |
*/ | |
function custom_facebook_admin_meta_tag() { | |
$userid = "123456"; | |
$meta = '<meta property="fb:admins" content="' . esc_attr($userid) .'">'; | |
echo $meta; |