Support » Plugin: Newsletter » Featured image not displayed for one post

  • Hi – I’ve been working with this plugin for a few days now, trying to understand it and also creating a simple template for it to create emails that will display well (and with large, readable text) on iPhones and other mobile devices.

    I’ve created a template that works (see below) but for some reason there’s one post on my blog for which the template fails to correctly read the featured image’s URL. Instead, the URL that it calculates (just for that one blog post) is the URL for the home page of the domain, but not anything that comes after the .com at the end of the home page URL.

    The post in question is at this URL:


    Here’s the template code:

    global $newsletter; // Newsletter object
    global $post; // Current post managed by WordPress

    * Some variabled are prepared by Newsletter Plus and are available inside the theme,
    * for example the theme options used to build the email body as configured by blog
    * owner.
    * $theme_options – is an associative array with theme options: every option starts
    * with “theme_” as required. See the theme-options.php file for details.
    * Inside that array there are the autmated email options as well, if needed.
    * A special value can be present in theme_options and is the “last_run” which indicates
    * when th automated email has been composed last time. Is should be used to find if
    * there are now posts or not.
    * $is_test – if true it means we are composing an email for test purpose.

    // This array will be passed to WordPress to extract the posts
    $filters = array();

    // Maximum number of post to retrieve
    $filters[‘showposts’] = (int)$theme_options[‘theme_max_posts’];
    if ($filters[‘showposts’] == 0) $filters[‘showposts’] = 10;

    // Include only posts from specified categories. Do not filter per category is no
    // one category has been selected.
    if (is_array($theme_options[‘theme_categories’])) {
    $filters[‘cat’] = implode(‘,’, $theme_options[‘theme_categories’]);

    // Retrieve the posts asking them to WordPress
    $posts = get_posts($filters);

    // Styles
    $color = $theme_options[‘theme_color’];
    if (empty($color)) $color = ‘#777’;

    $font = $theme_options[‘theme_font’];
    $font_size = $theme_options[‘theme_font_size’];

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
    * {
    font-family: <?php echo $font; ?>;
    font-size: <?php echo $font_size; ?>;

    <table width=”90%”>

    <tr align=”center”><td>


    <img src=”” alt=”Caring, Consistent, Dependable Caregivers in San Diego County” title=”Caring, Consistent, Dependable Caregivers in San Diego County”>

    <b><i>Where The Needs Of Others Come First!</b></i>

    <h1>News For Seniors and Their Families</h1>

    <tr align=”left”><td>
    Every week we publish articles for you on our website about the most relevant news about the art, science, business and politics of aging in the United States and the rest of the world. This edition of our newsletter summarizes the articles that we’ve published since the date of our last newsletter, and we hope you enjoy it!


    <tr><td align=”left”>

    <!–<p><img src=”<?php echo $theme_url; ?>/bg_header_email.gif” alt=””></p>–>

    <!–<p style=”color:#456;font-family:arial,sans-serif;font-size:24px;line-height:1.2;margin:15px 0;padding:0″>” style=”color:#28c;text-decoration:none” target=”_blank”><?php echo get_option(‘blogname’); ?></p>–>

    foreach ($posts as $post) {
    $image = nt_post_image(get_the_ID());

    <p style=”font-family:arial,sans-serif;color:#456;font-size:20px;line-height:22px;margin:0;padding:0″>
    ” target=”_blank”><img src=”<?php echo $image; ?>” align=”aligncenter” alt=”” border=”0″>
    ” style=”color:#456;text-decoration:none;align:center” target=”_blank”><?php the_title(); ?>
    <p style=”font-family:arial,sans-serif;line-height:1.5em;margin:15px 0;padding:0″>
    <?php the_excerpt(); ?>


    <p align=”center”>

    <img src=”” alt=”Caring, Consistent, Dependable Caregivers in San Diego County” title=”Caring, Consistent, Dependable Caregivers in San Diego County”>

    <b><i>Where The Needs Of Others Come First!</b></i>

    <p align=”center”>
    Caring, Consistent, Dependable
    Companions and Caregivers in North San Diego County</h2></p>
    <h3><p align=”center”>Call us toll-free at (800) 777-4750 today
    or visit us at</p>

    <p align=”center”>
    Your older loved ones can continue living in their own home with carefully screened caregivers provided by A Servant’s Heart, where the needs of others come first. All types of care are available, from simple companionship to complete personal and supportive care services.</p>

    <p align=”center”>
    A Servant’s Heart Care Solutions, Inc.
    250 S. Pacific Street, Suite 104
    San Marcos, California 92078
    t. 800-777-4750
    f. 760-874-2870</p>

    <p align=”center”><?php echo $theme_options[‘theme_pre_message’]; ?></p>


  • The topic ‘Featured image not displayed for one post’ is closed to new replies.