Support » Themes and Templates » add break to post title?

  • I am using the wordpress theme “Headlines” by woothemes, and I am trying to add a break in a post title so that I can get it on 2 lines.

    I want the name and position title on separate lines. I tried to set a fixed width to it, but it made my slider titles on homepage completely disappear, and yielded funky results with weird word groupings like…



    Alison Teracio, Om

    ….So, is there any other way to add a break to a post title without setting a fixed width?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Mark Ratledge


    Forum Moderator

    Only way I’ve figured this out in the past is to limit the post title and then add the extra info in custom fields and have them display under the title. The calls to the custom field data would go in the page template. If there was no data in a custom field, nothing would print.

    So you’d only have the name as the post title, and then add “Publisher” or “Designer” or other info in a custom field. That custom field would print with either the same CSS style or a different style, on lines below the post title. And the custom fields not be links in the way the post title is a permalink.



    Forum Moderator

    if you always (or at least on the category 4 page) want to do this, you could try to replace:
    <?php the_title(); ?>
    <?php echo str_replace(',','<br />',get_the_title()); ?>

    this replaces a comma , in the title with a html linebreak.

    ( if this is only for category 4, make a copy of category.php – or what ever displays this page – and save it under the name category-4.php; then edit ‘the_title();’ )

    Moderator Mark Ratledge


    Forum Moderator

    @alchymyth, good idea. Kind of like a custom field built into the_title.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add break to post title?’ is closed to new replies.