WordPress.org

Forums

Mini Loop Php Syntax HELP! (3 posts)

  1. Fess
    Member
    Posted 8 years ago #

    Hello,

    I've tried my best but the php syntax is a killer (noting like MEL). I'm a cg guy and don't know .php syntax.

    Anyway, problem is my mini loop. It has this indentation that I absolutely don't know how to get ride of.

    Please see this screenshot (the green arrows point to the problem areas).

    Is this indentation caused by the style, or the code in the blog_mini.php document?

    Hoping a .php savvy dude can kick some advice! Thanks.

    Here is the code in my blog_mini.php document

    <base target="_blank" />
    
     <link rel="stylesheet" type="text/css" href="http://www.mohan-conceptual.com/images/style_blogMini.css">
    
     <b>
    
    <?php
    $how_many=25; //How many posts do you want to show
    require_once("./blog/wp-config.php"); // Change this for your path to wp-config.php file ?>
    
    <ol id="whats-new">
    
    <?
    $news=$wpdb->get_results("SELECT <code>ID</code>,<code>post_title</code> FROM $wpdb->posts
    WHERE <code>post_status</code>= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
    foreach($news as $np){
    printf ("<li><a href=\"blog/index.php?p=%s\">%s</a></li>", $np->ID,$np->post_title);
    }?>
    </ol>
    
    </b>
    
    <p align="left"><a target="_blank" href="http://www.mohan-conceptual.com/blog"><b><u>More CG news></u></b></a></p>
  2. Chris_K
    Member
    Posted 8 years ago #

    We'll never know without a real link to observe, but I'd wager the issue is style/CSS.

  3. Fess
    Member
    Posted 8 years ago #

    that test page was taken down, sorry.

    I actually found that by replacing the <ol><li></li></ol> tags solved the indentation issue.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags