WordPress.org

Ready to get started?Download WordPress

Forums

Newsletter
[resolved] Text that is linked in the "new message" display ends up NOT linked in next step (6 posts)

  1. tcolling
    Member
    Posted 1 year ago #

    Ok, this is odd.

    I modified my original template, described in a preceding question here, in an attempt to make the entire excerpt itself be linked to the related blog post. I've been trying this for quite a while now. My latest version is shown below (just the relevant portion).

    The very weird thing is, when I first start the "new message" using this template, in the visual designer the body of the excerpt is a hyperlink as I intended, but then when I save the message in order to send it, the body of the excerpt is NOT hyperlinked in the html, only the blog title is. How can that be?

    - Tim

    ==============
    here's the relevant portion of the template code
    ==============

    <table width="90%">

    <?php
    foreach ($posts as $post) {
    setup_postdata($post);
    $image = nt_post_image(get_the_ID());
    ?>

    <tr align="left">
    <td>

    <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="right" alt="" border="0">

    " style="color:#456;text-decoration:none;align:center" target="_blank"><?php the_title(); ?>

    " style="color:#000;text-decoration:none;align:center" target="_blank"><?php the_excerpt(); ?>
    </p>

    </td>
    </tr>

    <?php
    }
    ?>

    </table>

    http://wordpress.org/extend/plugins/newsletter/

  2. jbx
    Member
    Posted 1 year ago #

    I had the same issue. Instead of the_excerpt() use echo get_the_excerpt() and if you want to wrap it in a <p> or anything do it manually. For some reason the HTML code generated by the_excerpt() interferes (I didn't investigate thoroughly what is actually happening, but the solution worked).

  3. tcolling
    Member
    Posted 1 year ago #

    Hi jbx: Thanks for trying to help, I appreciate it.

    I did what you said to do: the key line of code is this one, it used to say:

    " style="color:#000;text-decoration:none;align:center" target="_blank"><?php the_excerpt(); ?>

    and I changed it to say:

    " style="color:#000;text-decoration:none;align:center" target="_blank">
    <?php echo get_the_excerpt(); ?>

    But that didn't help: the excerpt is rendered as linked text in the "new message" window, but after you save it it renders as unlinked text in the "Save and send" window.

    <sigh>

    - Tim

  4. tcolling
    Member
    Posted 1 year ago #

    Whoops, wait a minute: although it doesn't look like it's linked text in the "save and send" window, the message that is actually sent DOES have the excerpt as linked text. That works.

    Thank you Thank you Thank you!

    - Tim

  5. jbx
    Member
    Posted 1 year ago #

    Cheers :)

    You should notice that in the WYSIWYG editor when you click on the text itself the Link icons get activated, which means they have a link.

    Glad it worked for you too.

  6. Stefano Lissa
    Member
    Plugin Author

    Posted 1 year ago #

    It seems not a link because there are applied styles, I believe. About the excerpt generating a <p> around the text is a "feature" of wordpress it cannot be removed or better, you should extract the excerpt and then replace the <p> and </p>.

    Stefano.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic