WordPress.org

Ready to get started?Download WordPress

Forums

Firefox mini-loop Error (5 posts)

  1. filduarte
    Member
    Posted 7 years ago #

    Hi, I'm using the mini-loop code in other page to show the lastest 5 posts in my blog. IE are executing the code perfectly, but Firefox doesn't. The title of the posts are showed, but the links to the respectives posts are changing "/" to "\" and the browser can't show the page.

    My code is this:

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"
    />
    <title>blog</title>
    </head>
    <body>
    <table width="170" border="0" cellpadding="0"
    cellspacing="0">
    <tr>
    <td width="170" height="133" align="left" valign="top"><?php
    $how_many=5; //How many posts do you want to show
    require_once("wp-config.php"); // Change this for your path to wp-config.php
    file ?>
    <?
    $news=$wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts
    WHERE post_status= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
    foreach($news as $np){
    printf ("&raquo; %s<br
    />
    ", $np->ID,$np->post_title);
    }?></td>
    </tr>
    </table>
    </body>
    </html>

  2. filduarte
    Member
    Posted 7 years ago #

    Somebody?!

  3. maerk
    Member
    Posted 7 years ago #

    Do you have a link to your site?

  4. Zoutesnor
    Member
    Posted 7 years ago #

    Since you didn't paste your code between code-tags I'm not sure about this, but it seems like your code reads blog\index.php somewhere, where it should be blog/index.php.

  5. filduarte
    Member
    Posted 7 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags