WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to configure my content-page.php but i'm struggling with a few 'mistakes'.

<article id="post-<?php the_ID(); ?>">
<div class="page_content">
<h1><?php the_title(); ?></h1>
**<p class="page_tekst">
<?php the_content(); ?>

This is my css content



This is the result in my browser

<article id="post-81">
<div class="page_content">
<p class="page_tekst">
<p>This is a test based on the current css code</p>

My css on the .page_tekst won't work. I also understand why but is there a solution for it? Can you make a div or p tag, give it a call and put the content in this tag without making another P tag with the content?

share|improve this question
P elements are not block elements, you should not be nesting them as the browser will correct the issue by separating them out into multiple elements. use a div or some other block element rather than an inline element such as a p tag – Tom J Nowell Jan 25 '13 at 22:55

WordPress inserts p tags in the_content(), otherwise it would be rather difficult for your content to contain more than one paragraph. If you want to target the p WordPress inserts, just change your css to:

.page_content p

and remove your wrapping <p> tag.

share|improve this answer
Thanks for your answer. What i'm trying to reach is to add some text together with a featured image. The image must 'wrap' around the text. But with your answer in my head, I think this is fully possible. Isn't it? Thanks! – Niels Jansen Jan 25 '13 at 22:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.