1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how can I get the ( read more )sintax on text editor to work with the code bellow

Discussion in 'Content Management' started by macaela, May 14, 2012.

  1. #1
    Hi I have this code that show the latest post on inside a small div on a home page but I wanted to add the more(<!--more-->)on the text editor but is not working, I have tried to change he sintax bellow with a the_excerpt but that stops the code bellow from displaying the latest post. can someone help me out please I want the post to display some content on the homepage and click more to take you to the post itself.

    Thanks in adavance.
    <?php
    
    
        function wptuts_recentpost($atts, $content=null){  
    	  global $more;    // Declare global $more (before the loop).
      $more = 0;       // Set (inside the loop) to display content above the more tag.
          
            $getpost = get_posts( array('number' => 1) );  
          
            $getpost = $getpost[0];  
          
            $return = $getpost->post_title . "<br />" . $getpost->post_content . "…";  
                
            return $return;  
          
        }  
        add_shortcode('newestpost', 'wptuts_recentpost');  
    
    ?>
    
    PHP:
     
    macaela, May 14, 2012 IP