add php code

  • Posted in : BookCard WP
  • WhiteOne
    Participant

    hello,

    where should i add this php code : <?php echo show_eap_ad_1(); ?>   to let it appear above “Share this post on:” section for all my portfolio post.

    post example: http://goo.gl/yjj86q

    Mehmet S.
    Keymaster

    Hi, you can add it to portfolio-single.php file.

    Thanks

    WhiteOne
    Participant

    yes, but where should i put it exactly in the code?
    i haven’t find the right place to add it to let it appear above “Share this post on:” section

    Mehmet S.
    Keymaster

    After this line:

    <!-- end Content Editor -->
    
    WhiteOne
    Participant

    hi, in this case it will appear under the “Share this post on:” section not above it .

    Mehmet S.
    Keymaster

    Try this way:

    – add this to the end of your theme’s functions.php file before the closing chars ?>

    add_filter( 'the_content', 'custom_content' ); 
     
    function custom_content( $content )
    {
        if ( is_singular( 'portfolio' ) )
    	{
            $content = $content . show_eap_ad_1();
    	}
    	
        return $content;
    }
    
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register