WordPress.org

Ready to get started?Download WordPress

Forums

New user, small problems/suggestions (7 posts)

  1. kmwill23
    Member
    Posted 7 years ago #

    I am a long time fan of HTML formatting my own pages. Editors always seem to complicate things. WIth that in mind...

    I noticed when adding/editing content within the blogs, the editor software automatically modifies any input HTML code. This is good in some instances, but in others it creates havok with normal HTML code which would work correctly if it didn't try to make changes for the user.

    Example: Using a simple unordered list. The tags for unordered lists don't need to be closed, and when the editor sees an unclosed 'li' tag it immediately searches for a place to add the closing tag. And errs in doing so.

    That is workable though, just requires a little adjustment. Another problem I found is that unordered lists, when encased in a 'ul' tag, does not display any list-style, like the disc, circle or square. Any attempt to add this STYLE on my own is removed by the editor.

    So, my suggestion, is there or can there be an option for disabling the auto-editing functions?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    The tags for unordered lists don't need to be closed...

    ALL tags need to be closed. Period. WordPress is not producing HTML, it's producing XHTML. And XHTML is an XML specification, and XML requires well-formed documents... Meaning that closing tags is never optional.

    Even single tags must be closed. [BR] for example, is invalid. You have to use [BR /] instead. (replace square brackets with angle brackets, obviously)

    As for styling, you can use explicit styles if you want to do so, but it's better to use the correct CSS mechanism and specify a class or an id for the element, which then has its styling specified in the separate CSS file. This gives you simple names for common styles that you use, and promotes consistency. Alternatively, your CSS may specify default styles for elements, giving you the same look and feel throughout the page unless you have specific reasons to override by using other classes and such. This way, when you want to change the look of the page, you never have to change the content, just the CSS.

    HTML is dead. We live in an XML world now. It's like HTML with specifications and internal consistency (well, mostly).

    If you really do want to disable the internal fixer-upper code (which does cause problems sometimes) then do two things:
    1. Disable the Visual Rich Editor (On the Users page, scroll down).
    2. On Options->Writing, turn off "WordPress should correct invalidly nested XHTML automatically".

    However, if you do this, and stick to your current methodology, it's quite likely that your page will fail to validate. Invalid code produces invalid results, and your page will likely not look the same on different platforms/browsers/etc. You'll have problems like weird behavior when people use different screen sizes and so forth.

    Making invalid markup is not really advisable. Validation really does make life simpler and it's easier to write too. You just have to relearn a few things. :-D

  3. vkaryl
    Member
    Posted 7 years ago #

    Actually the new <br> tag is <br />....

  4. kmwill23
    Member
    Posted 7 years ago #

    Thanks for the quick response! I guess my experience with XML was fairly transparent =) That's learnable.

    Before you suggested it, I started looking for ways to apply CSS styling. I tried the STYLE tag first, which the editor removes. Then I started looking for places to upload a seperate CSS document, which I have yet to find.

    I am limited to what I can do given the WordPress blog interface. I did not install it, I don't manage it, I don't have server access. I am just a blog user. How do I modify my styles?

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Ah. Well, the CSS file for the blog is part of the theme that the blog is using. If you go to the Presentation Page, and select the theme editor, you can see the Stylesheet your blog is using. In theory you can edit it here too, however I recommend against that and would suggest downloading it from the server via FTP to edit it manually and reupload it.

    If you don't have FTP access to your server, then I would get that access. Or talk to whoever does manage the blog to get that access. Once you have access, you can look in the /wp-content/themes/themename directory for the CSS file.

  6. ia
    Member
    Posted 7 years ago #

    Actually the new <br> tag is <br />

    Question: Why is the WordPress HTML editor using <br> instead of <br /> when it generates the code? Yes, I have "WordPress should correct invalidly nested XHTML automatically" checked in my options menu. :(

    Please help.

  7. Root
    Member
    Posted 7 years ago #

    HTML is dead

    It is?

Topic Closed

This topic has been closed to new replies.

About this Topic