• Hi.. how to filter tc_post_footer ?
    I want to add a related post (using shortcode) next to author info.
    The goal is show author info (span6) and related post (span6) in post footer.

    <?php add_filter ('tc_post_footer', 'tc_related_posts' , 10);
    function tc_related_posts () {
      if ( ! is_singular())
         return;
      echo [shortcode]  
    
    }
    ?>

    thanks and waiting for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author presscustomizr

    (@nikeo)

    Hi,

    I would suggest to rather use the __after_content hook and do_shortcode with a code looking like this :

    add_action ('__after_content', function () {
      if ( ! is_singular())
         return;
      echo do_shortcode('[shortcode]');
    } , 20 );

    PS : i use an anonymous function since this is quite short

    I hope this helps

    Thread Starter afjsystem

    (@afjsystem)

    yes, if using __after_content hook that i understood.
    actually, i want to make the related post inline with author box.

    how if i remove the tc_post_footer so the __after_content visible below article. then i added the author box info within __after_content.

    Is it will work ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘filter tc_post_footer’ is closed to new replies.