WordPress.org

Ready to get started?Download WordPress

Forums

Trying to Setup Recent Post box within template (1 post)

  1. frankendesigns
    Member
    Posted 5 years ago #

    I have the following code and should post recent posts on homepage but it is not working, can someone see what is the issue.

    ("showposts=1&offset=0");
    $my_query = new WP_Query( );
    echo "\r\n\r\r\n";
    while ($my_query->have_posts())
    {
        $my_query->the_post( );
        echo "\r\n\r\r\n<p>";
        the_content_rss( "", TRUE, "", 20 );
        echo "</p>\r\r\n\r\r\n<p><a href=\"";
        the_permalink( );
        echo "\">";
        $news1 = get_option( "stylewp_news1" );
        echo $news1;
        echo " &raquo;</a></p>\r\r\n\r\r\n";
    }
    echo "\r\n\r\r\n<div style=\"border-bottom:1px dotted #cccccc; margin-bottom:5px; padding:0px 0px 0px 0px; clear:both;\"></div>\r\r\n\r\r\n";

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.