Changing markup of Featured Posts Title using GFPC Plugin

Another small tips for Genesis Featured Posts Combo users. Using following script you can alter the H2 tag of Featured Posts title:


add_filter( 'gfpc_do_post_title_gfpc-widget-3', 'gfpc_change_post_title_markup', 10, 2 );
function gfpc_change_post_title_markup( $title, $instance ) {
  if( empty( $title ) )
    return;
    
  $title = str_replace( '<h2', '<h4', $title );  
  $title = str_replace( '</h2>', '</h4>', $title );
  return $title;
}

gfpc-widget-3 is my GFPC widget ID. You will replace this with your widget ID.

Attention: Above code is not required from v2.4. I already added the new field for title wrap. So you can easily edit the markup from appearance->widgets page.

Share This Article

Subscribe Membership Plan ($9.99/mo)

  • Get full access to all premium tutorials
  • Get Support for the posted content
  • Request for specific how-to tutorials
  • Cancel the subscription at anytime

Reader Interactions

3 Discussion to This Post

  1. Is it easy to remove the title at the top of the widget?
    Universally, not just for specific widget ID?

    Thanks

Leave A Reply

Your email address will not be published. Required fields are marked *