WordPress Split Description\Tagline into Multiple Lines

Add the Following Code to your Functions.php theme file ( under Appearance ) 

/*
 * Split Description\TagLine
 */
    function get_split_description() {
        $title = get_bloginfo( 'description', 'display' );;
        $lines = explode(' – ', $title);
        $output = false;
        $count = 0;
 
        foreach( $lines as $line ) {
            $count++;
            $output .= '<span class="line-'.$count.'">'.$line.'</span><br> ';
        }
 
        return $output;
    }

 

 

Change in your header.php file to use the following :

<p class="site-description"><?php echo get_split_description(); ?></p>
					<?php endif; ?

 

 

Then change your Tagline to line 1 – line 2 ( with a slash and space in between ) 

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 10.00 out of 5)
Loading...