• This might get confusing, but bear with me:

    I wanted a headlines list on my homepage (static, HTML)

    I found the php code for a Mini-loop.

    Now obviously I can’t put php into my html homepage, so I got a little creative-
    I made a page with the loop in it, saved as php, and <IFRAMED> the new page into the homepage.

    This works great, but with 2 exceptions:
    1) the list of headlines is justified as “center” and needs to be”left”
    2) (and most importantly) The links open in the IFRAME and need to open in a new window (i.e. – target=”_new”)

    Here is the php for the loop so far:

    <td>
    <?php define(‘WP_USE_THEMES’, false);
    require(‘./wordpress/wp-blog-header.php’);
    ?>
    <div id=”content” class=”narrowcolumn”>

    <h2>Lastest Posts:</h2>

    <?php
    # Here starts Mini Loop trick: You can use this code, but _at your own risk_
    # If you want to improve this code, you’re welcome ??

    $how_many=7; //How many posts do you want to show ?>
    <ul class=”whats-new”>
    <?
    $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 (”

    • %s
    • “, $np->ID,$np->post_title);
      }?>

      </div>

      </td>

      ——————————–
      I don’t understand php (yet) so I really need your help
      Thanks
      Seth

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Graphics

    (@graphics)

    Sorry!! the code f-up when I pasted it in,
    heres the code:

    <td>
    <?php define(‘WP_USE_THEMES’, false);
    require(‘./wordpress/wp-blog-header.php’);
    ?>
    <div id=”content” class=”narrowcolumn”>

    <h2>Lastest Posts:</h2>

    <?php
    # Here starts Mini Loop trick: You can use this code, but _at your own risk_
    # If you want to improve this code, you’re welcome ??

    $how_many=7; //How many posts do you want to show ?>
    <ul class=”whats-new”>
    <?
    $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 (”

    • %s
    • “, $np->ID,$np->post_title);
      }?>

      </div>

      </td>

    Thread Starter Graphics

    (@graphics)

    STILL F_UP one more time

    <td>
    <?php define(‘WP_USE_THEMES’, false);
    require(‘./wordpress/wp-blog-header.php’);
    ?>
    <div id=”content” class=”narrowcolumn”>

    <h2>Lastest Posts:</h2>

    <?php
    # Here starts Mini Loop trick: You can use this code, but _at your own risk_
    # If you want to improve this code, you’re welcome ??

    $how_many=7; //How many posts do you want to show ?>
    <ul class=”whats-new”>
    <?
    $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 (”

    • href=\”bloghome.htm?p=%s\”>%s
    • “, $np->ID,$np->post_title);
      }?>

      </div>

      </td>

    Thread Starter Graphics

    (@graphics)

    had to pull the “<a” out of the link

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I’m SOOO Close – PLEASE HELP’ is closed to new replies.