Forums

Paragraph and line breaks added to forms (1 post)

  1. David Law
    Member
    Posted 2 years ago #

    Using WP 2.8

    For SEO reasons I'm trying to convert affiliate links that I was nofollowing to be form links to protect link benefit, you can see an example at http://www.morearnings.com/2008/11/13/wrath-of-the-lich-king-leveling-guide-reviews-1-80/ near the bottom of the post in the last full paragraph there's a HERE link that I made using a form with some CSS formatting to make the form block element into an inline element and make it look like a text link (CSS not completely done yet, just need to fix the button width).

    By doing an affiliate link this way I don't have to use nofollow which protects the page from one of Google's dumb ass ideas of black holing the link benefit that you don't want to go to an affiliate link.

    Rant over :)

    Anyway, so I've got the code right (almost), but when I add a form to a page link with the format shown on the page above WordPress adds a br tag and a couple of p tags in inconvenient places! Was very surprised it added a br tag!

    Currently trying out a plugin that almost fixes the problem, but not quite, removes the br and p tags but the plugin is new and looks like still needs some work. When the plugin isn't activated I get this code

    <p>my text, blah, blah<br />
    </p><form class="flink" method="post" action="http://www.morearnings.com/track/click.php?id=71" target="_blank"><button class="bnofollow" title="External Link">here</button></form>
    <p>. more of my text.....</p>

    Bit strange adding br then /p don't you think?

    So we have a br followed by a carriage return and an end p tag added before the form and a carriage return and an p tag at the end of the form. When I added the code it was all inline with no carriage returns, br or p tags, so all the p, br and carriage returns are added by WordPress.

    I don't want to turn the auto paragraphing function off for the entire site, (will be using on dozens of sites) but I don't want it used on this form code.

    Any ideas?

    Tried wp-raw plugin http://wordpress.org/support/topic/280732?replies=3 which if I surround the entire paragraph the form is within it works, but then I loose formatting of the paragraph and if I add it in manually it messes up (I think the plugin needs work).

    Tried editing wp-includes/formatting.php around the wpautop function, but couldn't get rid of all the p's.

    David Law

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.