Wordpress help

Discussion in 'HTML & Website Design' started by aWas, Feb 19, 2010.

  1. #1
    I've created a movie site through wordpress (my own hosting). I want to know how do I integrate cpalead into the posts only AFTER the user presses read more option. Also will I have to add the code to every single post I create that I want to have cpalead on it? Thanks for your help.
     
    Last edited: Feb 19, 2010
    aWas, Feb 19, 2010 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Open single.php file of the theme directory and add this code on the top:

    
    <?php
    function add_cpalead($content){
        $cpalead = "[COLOR="Red"]CPALEAD[/COLOR]";
    
        return $content.$cpalead;
    }
    
    add_action("the_content","add_cpalead");
    ?>
    
    Code (markup):
    Replace the red CPALEAD to the code you want to add.
     
    s_ruben, Feb 24, 2010 IP