Forums

[resolved] How do I pull a post's Headline or Excerpt into a static HTML page? (5 posts)

  1. mednovus
    Member
    Posted 3 years ago #

    Hello all,

    Please help me integrate some of my dynamic WordPress blog content into my static (hum drum) HTML site.

    I do a fairly good job of providing fresh content on my blog page, but now I'm finding that the frequency of those updates have had the unintended consequence of burying my main (static) webpage in popular search results. So my goal now is to leverage the updates I do to the blog page to 'spoon feed' content updates to my main page. The problem is, I have no idea how to...

    What I'd like to do is find some script or service whereby I can pull the headlines or excerpts from, say, the last 10 posts to my blog, and drop them in a 'news ticker' window in my static page. Isn't RSS supposed to make that sort of thing (relatively) easy?

    I know that RSS is working on my site. I even stumbled across an old DIY post on another site which suggested NewsGator had a feature like I describe (http://www.askdavetaylor.com/how_can_i_add_the_ask_dave_taylor_rss_feed_on_my_web_site.html), but their site is completely restructured from the 'how to' explanation.

    Thank you in advance to anyone that can help me with ways to 'slurp' this info directly from my blog into my static page, or to find services (NewsGator or others) who can help me do it.

    Regards,

    T.Gilk

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    Something like:

    <?php
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    $posts=get_posts('showposts=10');
    foreach($posts as $post) {
    setup_postdata($post);
    ?>
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <?php
    the_excerpt;
     } ?>

    http://codex.wordpress.org/User:Jalenack/Integrating_Wordpress_into_an_Existing_Site

    http://www.daobydesign.com/blog/2007/07/modifying-wordpress-front-page/

  3. mednovus
    Member
    Posted 3 years ago #

    Actually, I'm not wanting to modify my WP page, I want to modify a completely non-WP, plain vanilla HTML page. I'd like to insert some sort of script that would pull headlines and/or excerpts (via RSS?) from my WP blog into my non-WP page.

  4. MichaelH
    Volunteer
    Posted 3 years ago #

    Okay, leave out the
    define('WP_USE_THEMES', true);

  5. mednovus
    Member
    Posted 3 years ago #

    Thank you... I'll give it a shot and let you know how it turns out!

Topic Closed

This topic has been closed to new replies.

About this Topic