On a page I’m working on – http://truth4life.org/schedule-and-location/ – I put a form at the bottom so visitors can get directions.
When I put it in, and when I go to edit it, there are no line breaks. However, if I highlight the area from the end of the text to the beginning of the form, and check the selection source, it appears that somehow 13 linebreaks have been added in.
What would be causing this, and how might I fix it?
I looked at the source, and there aren’t any line preaks in there…. it’s really odd….. I even looked throug the CSS and couldn’t find anything in there either.
Buuuut…. your menu is broken… there’s an opening li tag jsut before Meta…. but I don’t see the corresponding close li tag…
Going through this may help too:
FYI: Before you freak, that very first error causes the next 5 or so… it’s because the first script tag needs to move into the head section, and the first link rel tag needs its terminating /> on the end. Then revalidate it and see how many of the errors clean up.
You’ve also go a few areas where you have h tags inside of p tags, which isn’t allowed (under W3C guidelines). Some of it seems trivial and you may or may not be interested in being w3c compliant, but sometimes, that’s the root of the problem.
I’ve about given up on trying to validate anything with WP. For some reason, it seems that WP radomly mangles the code, rendering what was valid in an invalid manner. For instance, the missing close li tag is indeed in sidebar.php, but when WP renders the page, it is gone. Or the script is located in the header, but WP renders it in the body; the h tags are not in paragraphs on the original, it is only when rendered by WP that they are placed inside of a paragraph.
I can’t figure out how to force WP to leave the code alone, so I quit worrying about validation. Not good practice, I know, but I don’t know what else to do.
As far as the line breaks, if I do just a view page source, they don’t show up, BUT, if I use the Firefox Web-Developer toolbar, and highlight just that section, they do show up.
Since this came up, is there any way to stop WP from arbitrarily wrapping p tags around any other tags?
It seems to happen to h tags, div tags, form tags, and probably others.
Or, is there a way edit our static pages outside of the WP editor? In other words, is it possible to use a text editor that doesn’t add in arbitrary code?
Being that it is written in PHP code, WP does not “arbitrarily” do anything. There is a way to suspend autop, is the ability to search back up?…
yep… evidently you may do it manually, use this plugin or there is another plugin to do it on a post-by-post basis.
Ok, I don’t have a clue what a wpautop is, so I certainly would have had no way of knowing to search for it.
In any case, I installed this plugin, and now everything has TWO p tags wrapped around it. Now I didn’t code it that way, so by definition, it was ‘arbitrarily’ inserted.
I’m sorry I don’t have all of the technical vocababulary that some seem to like to flaunt, but then again, if I did, I probably wouldn’t need to be on here, asking for help. Thankfully there are some who are willing to help and for that I am appreciative.
The autop thing is that if you type a paragraph into the WP write post screen, it will format and display it as a paragraph. Thus the p tags. If you turn that off, then you will have to manually insert the code yourself. Some people like to do that. If you don’t want to do that, then you should turn that plug in back off. I don’t know why it would insert double p tags, that seems really odd.
And, as TG and Beel were saying, it might be best to get the site valid, that would help a lot in figuring out the issues. WP doesn’t just add or drop code for no reason, something somewhere must be telling it to. We can help you work through the errors if you need it.
If I were a betting gnome, I’d be willing to bet that if you changed the theme to Classic or the KubrikDefault, it’ll come out right. I wonder if you’ve gotten a hold of a bad template or something.
I guess I’m going to have to accept that, for whatever reason, WP is not going to validate for me.
I just tried switching to the default template and the errors rose to 74; almost all of them were related to multiple p tags.
Besides which, the church governing board absolutely abhors the look of the default theme for a church web site.
Switching back to the theme they have chosen, this page now comes up with 57 errors, again, nearly all of them are caused by these phantom p tags. What is even more confusing is that I am not using any p tags of my own, I supposedly have this wpautop thing turned off, and I’m still getting 2 and sometimes 3 p tags wrapped around each line on the page.
Does it matter that this is a static page and not a post? Is there some other sort of widget that would control formating for pages?
I don’t understand the double p tags at the beginning of the post, but I seem to understand a lot of p tags that come later: if you put the li tags on their own line with blank lines in between – WP does add p tags. Hitting the Enter twice = new paragpraph.
Doubt if it is in the template and no one is saying you need to stick with the default or classic theme. We are suggesting a “nonarbitrary” means by which to figure out the problem (and WP uses code which is a set of instructions applied consistently and not by chance so “by definition” it is not arbitrary).
Switch to the unedited classic theme or the default theme and turn off all plugins. It should validate fine. Perhaps you have a plugin that is causing the problem. Once you track down the problem you then can work your way back to the theme you have chosen.
I use WP for 2 church sites and they validate fine – well they did until one of my plugins causes an errant p tag in another plugin which allows for php in posts.
I admit that I am in over my head in trying to understand anything about php, so here is a link to a text file that I just uploaded that is the page template I am using:
Perhaps something is wrong with that?
moshu – thanks for the heads up on the extra lines with the li; I didn’t catch that as that is the way the quick tag editor set them up.
- The topic ‘Why the large amount of white space?’ is closed to new replies.