• All of my standard span elements are producing line breaks which aren’t apparent in my CSS. I assume WordPress is creating them before and after standard functions such as the_title();.

    How can I remove them?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I assume WordPress is creating them before and after standard functions such as the_title();.

    no –

    plese post a link to your site to illustrate the problem.

    Thread Starter Jack

    (@enoda)

    Everything is done locally, so here’s my code:

    index.php:

    <section <?php post_class() ?>>
    	<article>
    		<span class="title"><?php the_title(); ?></span>
    		<span class="content"><?php the_content(); ?></span>
    		<span class="date"><?php the_time('F j') ?></span>
    	</article>
    </section>

    style.css

    section{
    	padding: 60px;
    	background: #eee;
    }
    
    article{
    	color: #666;
    	padding-left: 10%;
    	padding-right: 10%;
    	padding-bottom: 10px;
    }
    
    span.title{
    	color: #333;
    	font-weight: 500;
    }
    
    span.title::after{
    	content: " 0BB";
    
    }
    
    span.date{
    	color: #ccc;
    	white-space: nowrap;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I remove the line breaks in functions such as the_title?’ is closed to new replies.