Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srikat/b21c32a401af17324132 to your computer and use it in GitHub Desktop.
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/
// Register a custom image size for Home Boxes images
add_image_size( 'home-box', 300, 300, true );
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;
}
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;
}
#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