Advertisement
srikat

Untitled

Jun 3rd, 2015
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. add_action( 'gfpc_entry_header', 'lb_do_custom_post_title', 8, 2 );
  2. function lb_do_custom_post_title( $instance, $widget_id ) {
  3. $a_wrap_open = $a_wrap_close ='';
  4.  
  5. // if($instance['title_link'] == 'permalink') {
  6. // $link = ( get_post_meta( get_the_ID(), 'other_permalink', true ) ) ? get_post_meta( get_the_ID(), 'other_permalink', true ) : get_permalink();
  7. // $a_wrap_open = sprintf('<a href="%s" title="%s">', $link, the_title_attribute( 'echo=0' ) );
  8. // $a_wrap_close = '</a>';
  9. // }
  10.  
  11. $custom_page_title = ( get_post_meta( get_the_ID(), 'title_for_homepage_boxes', true ) ) ? get_post_meta( get_the_ID(), 'title_for_homepage_boxes', true ) : get_the_title();
  12.  
  13. if ( !empty( $instance['show_title'] ) && !empty( $instance['title_limit'] ) )
  14. $title = sprintf( '<h2 class="entry-title">%s%s%s%s</h2>', $a_wrap_open, genesis_truncate_phrase( $custom_page_title, $instance['title_limit'] ), $instance['title_cutoff'], $a_wrap_close );
  15. elseif ( !empty( $instance['show_title'] ) )
  16. $title = sprintf( '<h2 class="entry-title">%s%s%s</h2>', $a_wrap_open, $custom_page_title, $a_wrap_close );
  17.  
  18. echo apply_filters( 'gfpc_do_post_title_'. $widget_id, $title, $instance);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement