WordPress.org

Forums

HTML clean-up and other questions (7 posts)

  1. rookcifer
    Member
    Posted 7 years ago #

    I am not extremely proficient with HTML or CSS, so I apologize if this sounds like a stupid question. I have a couple of them.

    #1 I want to get my page validated but I don't know where to paste the code that HTML Tidy provides. None of the files in my theme are HTML documents. Which CSS or PHP file should I add this HTML code to?

    #2 Is there any way to avoid having theme headers above each and every widget? Do I need to post the widget code manually? If so, where? And what is the code?

    #3 This question has bothered me for a few days: how do I change the color of the columns (the outer margins of the page)? I have searched google and looked through the css code in my theme but I see no reference to the columns.

  2. theapparatus
    Member
    Posted 7 years ago #

    1 - What's the code that you're trying to add in? (If you post it here, place the code here within backticks. That's the key above the tab key and to the left of the '1' key on a standard pc keyboard) Does HTML Tidy suggest any place to put it.

    I always suggest using http://validator.w3.org myself

    2 - Link please so we can see what is occuring.

    3 - Ditto

  3. moshu
    Member
    Posted 7 years ago #

    BTW, do NOT post long code here - it will be deleted!
    Use http://wordpress.pastebin.ca/

  4. theapparatus
    Member
    Posted 7 years ago #

    I had a feeling that it was one of those one line things that they had to add which is why i didn't mention that.

  5. rookcifer
    Member
    Posted 7 years ago #

    What's the code that you're trying to add in? (If you post it here, place the code here within backticks. That's the key above the tab key and to the left of the '1' key on a standard pc keyboard) Does HTML Tidy suggest any place to put it.

    I used the W3 HTML validate page, but that site also offers a "cleaned up" code for your page by using HTML Tidy (which is third party). The code that Tidy provides is the entire HTML code for the page in question.

    The problem I have is that the cleaned up code is HTML and I don't know where to put HTML code in my template. Like most templates, it only uses CSS and PHP files. So my question is, how does one use this cleaned up code? Where do you put it? My site seems to function just fine, but I received like 90 errors on the W3 validation page (many of them appeared after pasting widgets). I have learned this will degrade the functionality of the search engine crawlers, so I want to fix it for that reason.

    Here are the files that make up my template:

    archive
    footer
    header
    index
    page
    search
    404
    comments
    functions
    home
    Left sidebar
    Right sidebar
    Style

    All of these files are PHP except for the style sheet, of course. There is no index.html file, which is what HTML Tidy seems to be providing code for. It's the code that one sees when one hits "view source" in one's browser. Again, the problem I have is I don't know where this code is in my template. Do I need to be using the CSS validation page instead?

    Now for the other questions: you can see my site here What I want to do is provide a background color for my sidebars, and I want to change the color of my page columns or margins (whatever you call the blank sections on the far left and far right).

    Thanks for the help, guys.

  6. rookcifer
    Member
    Posted 7 years ago #

    Bump.

    Can anyone tell me how to clean up the code after an HTML validation scan? As you know, the WordPress templates do not contain HTML files. How does one correct the HTML when there are no HTML files? My CSS is pretty much clean, so I know I don't need to edit the style sheet or the php files.

  7. kmessinger
    Forum Moderator
    Posted 7 years ago #

    You cannot paste in what HTML Tidy gave you. It gave you your entire page but in WP your page is made up of sections.

    The validator doesn't know about sections either so you have to figure out what and where it is talking about. That is what the line numbers can be used for. Usually some errors will be in the header.php file as there should be html there. Afterwards you will probably find errors in text widgets and finally in the footer.php file.

    You can bring up your page, go to source, copy it and paste it into a text editor (not word) and then when the validator shows an error on line 189, go to 189 in your editor and figure out where that would be in WP. Then go there and correct it. The errors are cascading in that if you fix one, then revalidate, somtimes many go away.

    So, what I do is validate, correct any errors on the files on my computer then upload them to the server. Then I revalidate. I do this for every error.

    BTW, you should also validate your css from links on the validator site.

Topic Closed

This topic has been closed to new replies.

About this Topic