Viewing 6 replies - 1 through 6 (of 6 total)
  • Safeer

    (@safeerz)

    You will need to chnage the html file to php and try like this

    // Include the wp-load’er
    include(‘news/wp-load.php);

    // Get last 10 posts
    // Returns posts as arrays instead of get_posts’ objects
    $recent_posts = wp_get_recent_posts(array(
    ‘numberposts’ => 10
    ));

    // list post
    echo ‘

    ‘;

    Thread Starter rmw_in

    (@rmw_in)

    Yesterday i found following script and its working

    <?php
    define(‘WP_USE_THEMES’, false);
    require(‘/home2/mazegaon/public_html/udannsports.org/news/wp-blog-header.php’);
    ?>
    <?php

    global $post;
    $args = array( ‘posts_per_page’ => 5);
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) : setup_postdata($post); ?>
    <div class=”regards”>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></div>
    <div class=”regards”><?php the_date(); echo “
    “; ?></div>
    <?php endforeach; ?>

    But i have one issue showing warning on the top of the live posts

    Warning: Cannot modify header information – headers already sent by (output started at /home2/mazegaon/public_html/udannsports.org/xyz.php:14) in /home2/mazegaon/public_html/udannsports.org/news/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 62

    Thread Starter rmw_in

    (@rmw_in)

    Dear Team,
    Some one can help me on last post issue?
    Plz its urgent for me.

    Safeer

    (@safeerz)

    Thread Starter rmw_in

    (@rmw_in)

    I go through the your provided link and i remove every thing before and after <?php … ?> and its working file…
    Warning massage gone …

    Thnx…:)

    But i m littlebit confuse abt css stylesheet link. where i can link css sylesheet link in below script? I already try in <head> tag but same warning massage shown.

    ******************
    <?php
    require(‘/home2/mazegaon/public_html/udannsports.org/news/wp-blog-header.php’);
    echo (‘css/style.css’);
    ?>
    <?php
    global $post;
    $args = array( ‘posts_per_page’ => 5);
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) : setup_postdata($post); ?>
    <div class=”regards”>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></div>
    <div class=”regards”><?php the_date(); echo “
    “; ?></div>
    <?php endforeach; ?>
    *****************************

    Safeer

    (@safeerz)

    There is no such thing like
    echo ('css/style.css');

    Consider that you page is a default php page and you can include stylesheet as usual. It would be good to google and get some basics ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to Link/Embed WP Latest Post to other websites’ is closed to new replies.