This file contains hidden or 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 | |
// Remove Post Info, Post Meta from Food Recipes Archive Page | |
function chloe_remove_post_meta() { | |
if( is_post_type_archive( 'food-recipes' ) ) { | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
} | |
} | |
add_action ( 'genesis_entry_header', 'chloe_remove_post_meta' ); |
This file contains hidden or 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 | |
// Edit read more link on certain cpt archive | |
add_filter( 'get_the_content_more_link', 'chloe_read_more_link' ); | |
function chloe_read_more_link() { | |
if ( is_post_type_archive( 'food-recipes' ) ) { | |
return '<p class="text-center"><a class="button get-recipe" href="' . get_permalink() . '">Get The Recipe Here</a></p>'; | |
} |
This file contains hidden or 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 | |
// Move post image above post title | |
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); | |
add_action( 'genesis_entry_header', 'genesis_do_post_image', 3 ); |
This file contains hidden or 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 food_recipe_image_size( $image_size ) { | |
// Only run on the 'image' post type archive | |
if( is_post_type_archive( $posttype ) ) | |
$image_size = 'recipe-thumbs'; | |
return $image_size; |
This file contains hidden or 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('post_class', 'jay_grid_view_post_class'); | |
function jay_grid_view_post_class( $classes ) { | |
if( is_post_type_archive( $posttype ) ): | |
$columns = 3; | |
$classes[] = 'one-third'; | |
global $wp_query; | |
if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % $columns ) | |
$classes[] = 'first'; |
This file contains hidden or 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( 'the_content', 'jay_remove_autop', 0 ); | |
function jay_remove_autop( $content ) { | |
// change 'post-type' to the custom post type | |
'post-type' === get_post_type() && remove_filter( 'the_content', 'wpautop' ); | |
return $content; |
This file contains hidden or 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 | |
define('COMPASSIONATE_SETTINGS_FIELD','compassionate-settings'); | |
class COMPASSIONATE_THEME_SETTINGS extends Genesis_Admin_Boxes { | |
function __construct() { | |
$page_id = 'compassionate'; |
This file contains hidden or 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 | |
/* | |
* Call using [jay-home-recent/] shortcode | |
*/ | |
// Home recent shortcode | |
add_shortcode( 'jay-home-recent', 'jay_post_listing_shortcode' ); | |
function jay_post_listing_shortcode($atts) { |
This file contains hidden or 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 jay_widget_form_extend( $instance, $widget ) { | |
if ( !isset($instance['classes']) ) | |
$instance['classes'] = null; | |
$row = "<p>"; | |
$row .= "<label for='widget-{$widget->id_base}-{$widget->number}-classes'>Additional Classes <small>(separate with spaces)</small></label>"; | |
$row .= "<input type='text' name='widget-{$widget->id_base}[{$widget->number}][classes]' id='widget-{$widget->id_base}-{$widget->number}-classes' class='widefat' value='{$instance['classes']}'/>"; | |
$row .= "</p>"; |