• Resolved okuzero

    (@okuzero)


    Hello all =)

    1st thank you for any help with this and btw I am somewhat new to coding =)

    I was using the Permalink shortcode for a ‘per post’ HTML email. What I wanted is just to have something say “View The Post” and link to the {PERMALINK}.

    My code is (inside a <table> & <tr> of course):

    <td align="center" valign="top" bgcolor="#007BC6">
    <a href="{PERMALINK}">View The Post</a>
    </td>

    I tried also with an image:

    <td align="center" valign="top" bgcolor="#007BC6">
    <a href="{PERMALINK}">
    <img src="https://linktomyimage.jpg" width="138px" alt="ViewBlogPost">
    </a>
    </td>

    But what it does is break right after the 1st quotation mark, shows the full link followed by a quotation and ending bracket showing like this (with the quotation & bracket at end of link):

    https://ibm.conres.com/top-5-ways-to-prevent-phishing-attacks.htm">
    View The Post

    Is there a way to hide the full URL of the {PERMALINK} and just show “View The Post”. I even tried to attach to an image and it breaks in the same way.

    Here is image (low quality sry) of the section of the email (1st with text & 2nd with image):

    https://www.tslovesdesign.com/BradyURL/VTP.JPG
    https://www.tslovesdesign.com/BradyURL/VTP2.JPG

    Did I do something wrong? Or, can you not hyperlink the {PERMALINK} to text/ an image?

    Ty for all your help (hopefully I explained good enough)!

    https://www.ads-software.com/plugins/subscribe2/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter okuzero

    (@okuzero)

    Also (sorry..)

    Huge spacing gaps (maybe two BR’s worth) are happening before and after every <td>.

    For example this:

    <table align="center" cellpadding="0" cellspacing="0" style="border:2px solid #007bc6; border-radius:5px; width:500px;display:block;" >
       <tr>
          <td align="center" valign="top">
             <a href="{BLOGLINK}"><img src="https://ibm.conres.com/wp-content/uploads/2015/01/conres_logo-300x79.jpg" alt="{BLOGNAME}" width="200"></a>
             <hr color="#007bc6" noshade>
             <h1 style="color:#007bc6; font-size:18px; line-height:21px; font-family:'Trebuchet',Arial,Sans-Serif;font-weight: 100;font-weight:800;">{TITLE}</h1>
             <font>{POST}</font>
          </td>
       </tr>
    	</table>

    Has a huge gap at the top of the email. Its like someone pressed enter 3 times before the logo appears. Does anyone know where that spacing would come from?

    Ty!

    @okuzero

    Second issue is easier to fix, remove the line breaks from the Temaplte HTML once you are satisfied – so instead of:

    <table>
    <tr>
    <td>
    </td>
    </tr>
    </table>

    Use:
    <table><tr><td></td></tr></table>

    @okuzero

    I’ve still not figured anything out with the first issue. Are you using Subscribe2 free or the Subscribe2 HTML (paid) version?

    Thread Starter okuzero

    (@okuzero)

    @mattyrob

    Nice to you meet you! I have seen your help on here a lot (thank you for your time).

    I am only using Subscribe2 free. It’s odd, because basically I want to do the same thing I am doing to {BLOGLINK}. That elements will allow an image to link (without showing the actual URL, like the above images). But {PERMALINK} breaks right after the 1st quotation mark after href=”

    I apologize if my explaining is a little rough, I am somewhat new to WP.

    I hope this is not against the rules (if so I will remove), but here is my full code:

    <table align="center" cellpadding="0" cellspacing="0" style="border:2px solid #007bc6; border-radius:5px; width:500px;display:block;" >
       <tr>
          <td align="center" valign="top" cellspacing="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
            <div style="text-decoration:none !important;"><font style="color:#007bc6 !important; font-size:17px; line-height:22px; font-family:'Trebuchet',Arial,Sans-Serif;font-weight: 800;">{TITLE}</font></div>
             <font style="color:#000000; font-size:14px; line-height:18px; font-family:'Trebuchet',Arial,Sans-Serif;font-weight: 100;">{POST}</font>
          </td>
       </tr>
       <tr>
        <td align="center" valign="top" bgcolor="#007BC6" cellspacing="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
             <font style="color:#FFFFFF; font-size:18px; line-height:21px; font-family:'Trebuchet',Arial,Sans-Serif;font-weight:800;">View The Post Here:</font>
             {PERMALINK}
          </td>
       </tr>
       <tr>
          <td cellspacing="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" align="center" valign="top" bgcolor="#FFFFFF" style="font-size:0.7em;">
             <font>You received this e-mail because you asked to be notified when new updates are posted.</font>
          </td>
       </tr>
    <tr>
    <td>
    <a href="{BLOGLINK}"><img src="https://www.marketingsherpa.com/images/TSL_Logo.gif" alt="{BLOGNAME}" width="200"></a></td></tr>
    </table>

    However, I saw a post that said that {PERMALINK} anchor option is only available through the paid version (if that is even related). From this post: https://www.ads-software.com/support/topic/link-color-in-html-template?replies=8

    I found the above post when I was trying to figure out how to style the {TITLE} (like font color specifically). And also how to style the link color for {PERMALINK}. Both I have no had success styling unfortunately (was gonna be a question but the link breaking was a little more important).

    @okuzero

    Okay, I figured it out, Subscribe2 is already creating a hyperlink with the {PERMALINK} keyword in the code. The following is in the substitute() function in the class-s2-core.php file. I think that’s why I created the {PERMAURL} keyword in the paid version.

    $link = '<a href="' . $this->get_tracking_link( $this->permalink ) . '">' . $this->get_tracking_link( $this->permalink ) . '</a>';

    Options you have:
    1/ Don’t hyperlink in your template
    2/ Have the plugin code on that line above (and re-apply the hack after each update)
    3/ Get Subscribe2 HTML and use {PERMAURL}
    4/ Write a little code to use the ‘s2_custom_keywords’ filter as documented in the plugin API to create your own {PERMAURL} keyword (or similar)

    Thread Starter okuzero

    (@okuzero)

    @mattyrob

    Thank you very much! The spacing issue is solved (removed the breaking/ formatting of the HTML) – Much Appreciated!

    I am working on resolving the {PERMALINK} answer you just suggested (will update once tested).

    Thread Starter okuzero

    (@okuzero)

    @mattyrob

    I apologize quick question. I was going with Option 2 to test it out. So, I went into the class-s2-core.php and found the code:

    $link = "<a href=\"" . $this->get_tracking_link($this->permalink) . "\">" . $this->get_tracking_link($this->permalink) . "</a>";

    I see some of the spacing/coding is a bit different and I replaced it with your above code:

    $link = '<a href="' . $this->get_tracking_link( $this->permalink ) . '">' . $this->get_tracking_link( $this->permalink ) . '</a>';

    I know I would have to update after every update. But was the process correct, or did I just miss what you meant completely (sry if so)?

    Here is what I see after doing the above (just that part):
    https://www.tslovesdesign.com/BradyURL/VTP3.JPG

    Here is my HTML (formatting removed due to the spacing fix):

    <table><tr><td align="center" valign="top" bgcolor="#007BC6"><a href="{PERMALINK}"><img src="https://ibm.conres.com/wp-content/uploads/2015/07/ViewThePost.jpg" width="138px" alt="ViewBlogPost"></a></td></tr></table>

    Ty!

    @okuzero

    In hacking the code you need to take the HTML out of that line so change:
    $link = "<a href=\"" . $this->get_tracking_link($this->permalink) . "\">" . $this->get_tracking_link($this->permalink) . "</a>";

    To something like:
    $link = $this->get_tracking_link($this->permalink);

    Thread Starter okuzero

    (@okuzero)

    @mattyrob

    It.. Worked! =)

    Man you are probably tired of answering questions.. But, I could hug you.

    Thank you for all your help. If I can return the favor any way (maybe social share a site or service of your, rate you some how on here, like a page, ..etc) just let me know.

    Regards,
    -okuzero

    @okuzero

    Hugs will do just fine – glad you have it working ??

    Thread Starter okuzero

    (@okuzero)

    @mattyrob

    Marked as resolved.

    =) !!!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Permalink breaking when added to an image/text.’ is closed to new replies.