WordPress.org

Ready to get started?Download WordPress

Forums

Posting a post's Thumbnail Image outside of WordPress install folder (3 posts)

  1. mrgoodfox
    Member
    Posted 3 years ago #

    I'm using the following code to pull the blog posts outside the blog install

    ?php
    require('/home/USERNAME/public_html/blog/wp-blog-header.php');
    ?>
    <?php query_posts('showposts=5'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <h3><a>" rel="bookmark" title="Read The Entire Post"><?php the_title(); ?></a></h3>
    <p><?php the_excerpt(); ?></p>
    <?php endwhile;?>

    I want to also pull the thumbnail image out of wordpress too. How can i do that? The thumbnail image is a custom field.

    Thanks

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    The thumbnail image is a custom field

    Does that mean you don't use WP's built in featured image/thumbnail feature?

    If you do use it, then @Ipstenu's advice is spot-on.

    But if you are putting URLs into a custom field for the image, then get_post_meta is what you are after.
    http://codex.wordpress.org/Function_Reference/get_post_meta

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.