WordPress.org

Ready to get started?Download WordPress

Forums

How can I remove the line breaks in functions such as the_title? (3 posts)

  1. Jack
    Member
    Posted 2 years ago #

    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?

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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.

  3. Jack
    Member
    Posted 2 years ago #

    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;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic