Last active
August 29, 2015 14:22
-
-
Save srikat/b21c32a401af17324132 to your computer and use it in GitHub Desktop.
Custom Page Titles in Genesis Featured Posts Combo Plugin's Widget. https://sridharkatakam.com/custom-page-titles-in-genesis-featured-posts-combo-plugins-widget/
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
// Register a custom image size for Home Boxes images | |
add_image_size( 'home-box', 300, 300, true ); |
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( 'gfpc_before_entry', 'gfpc_four_cols', 10, 2 ); | |
function gfpc_four_cols( $instance, $widget_id ) { | |
if ( ( $widget_id == "gfpc-widget-2" ) && ( $instance['layout'] == 'layout-seven' ) ) { | |
add_filter( 'post_class', 'adding_one_fourth_class' ); | |
} | |
} | |
add_action( 'gfpc_after_entry', 'gfpc_remove_filter', 10, 2 ); | |
function gfpc_remove_filter( $instance, $widget_id ) { | |
if ( ( $widget_id == "gfpc-widget-2" ) && ( $instance['layout'] == 'layout-seven' ) ) { | |
remove_filter( 'post_class', 'adding_one_fourth_class' ); | |
} | |
} | |
function adding_one_fourth_class( $classes ) { | |
$classes[] = "one-fourth"; | |
return $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
add_filter( 'gfpc_do_post_title_gfpc-widget-2', 'sk_custom_title', 10, 2 ); | |
function sk_custom_title( $title, $instance ) { | |
$replace = 'href='; | |
$replace_with = 'class="button" href='; | |
$title = str_replace( $replace, $replace_with, $title ); | |
return $title; | |
} |
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
#gfpc-widget-2 .layout-seven .one-fourth:nth-of-type(4n+1) { | |
clear: both; | |
margin-left: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment