[GFPC Plugin] Add Recent Articles text between Big One post and the Mini Block posts

Original Request:

I’m currently using Layout #4. I’m curious if there is a way to place “Recent Articles” between Big One post and the Mini Block posts like the screencap attached?

add-custom-headline

I did this very simple way. GFPC plugin have a hook “gfpc_after_entry“. I used this hook and added the following code in functions.php file:

global $gfpc_counter; 
$gfpc_counter = 0;

add_action( 'gfpc_after_entry', 'gfpc_add_heading', 15, 2);
function gfpc_add_heading( $instance, $widget_id ) {

  //* Return false if you are not using Layout Four
  if( $instance['layout'] != 'layout-four' )
    return;
  
  global $gfpc_counter, $paged;
    
  if( $gfpc_counter > 0 || $paged > 1 ) 
    return;
  
  //* Display the heading. Change the "textdomain" with your theme name.  
  echo '<h2 class="widgettitle heading" itemprop="headline">' . __( 'Recent Articles', 'textdomain' ) . '</h2>';
    
  $gfpc_counter++;
  
}

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

Leave A Reply

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