WordPress.org

Ready to get started?Download WordPress

Forums

please do not dictate how we should do with our markups (3 posts)

  1. alsd
    Member
    Posted 4 years ago #

    I am new to WordPress, find a few annoying things how WP generates markups. Not sure if this is normal behaviour or bug in v2.8

    1. sidebar widget - UL only. Sometimes DL is more appropriate. It's disturbing that you force users to use only UL tag.

    2. This is the most annoying of all I have encountered thus far:
    WP injects a p tag around my paypal button and a br tag after the opening of label .

    I have this :

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <div><input type="hidden" name="cmd" value="_s-xclick" />
    <input type="hidden" name="hosted_button_id" value="62" /><div>
    <label for="d2"><input type="image" id="d2" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" /></label></form>  </div>

    and the output becomes this:

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <div>
    <input type="hidden" name="cmd" value="_s-xclick" />
    <input type="hidden" name="hosted_button_id" value="6423892" /></div>
    
    <p><label for="d2"><br />
    <input type="image" id="d2" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" /></label></form>

    Basically it inserted an opening p without closing it and added a br tag after the opening label tag.

  2. Doodlebee
    Member
    Posted 4 years ago #

    Hello! I will address a few of these, if you don't mind :)

    1) Actually, you can use whatever you want. You aren't forced to use UL if you don't want to. You just have to customize what you need to have done, depending on what widget you choose to use.

    2) that's the "wpautop" filter. There's lots of questions on how to remove it. But in this case, your best bet is to either write a function to display the button exactly how you want to, *or8 just don't put any line breaks in your code. no line breaks = no extra paragraph tags. (Yeah, that one annoys me too).

    But your best bet is to just wrote a customized function for stuff like paypal buttons, and have the ability to insert whatever variables you need to.

  3. alsd
    Member
    Posted 4 years ago #

    I have to disagree.

    I am talking plain html markups. If one needs to write a function to overwrite a default behavior when it shouldn't be a default behavior to begin with, then that is not "you can use whatever you want". That is a dictatorship with a tiny bit of so-called benevolent–yes you can have it your way, but before you can have it your way, you have to go through this and that loops first.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.