Forums

[resolved] Truncate Titles (6 posts)

  1. RenFromPenn
    Member
    Posted 2 years ago #

    Hi,

    I have the previous and next posts displaying at the bottom of my posts. Now, the problem is that some the post titles are too long and throwing everything off. Is there a way to truncate the titles so that, let's say, only the first 50 characters appear?

    Here is the code that I am using:

    <div class="navigation" style="padding-top: 15px; padding-bottom: 10px;">
    	<div style="float: left;"><?php previous_post_link('&laquo; Previous Post: %link', '%title'); ?>
    </div>
    	<div style="float: right;"><?php next_post_link('Next Post: %link &raquo;') ?></div>
    </div>
  2. Shane G
    Member
    Posted 2 years ago #

    Hi,

    To manage next previous links..refer this article:

    http://codex.wordpress.org/Next_and_Previous_Links

    Thanks,

    Shane G.

  3. RenFromPenn
    Member
    Posted 2 years ago #

    I did refer to that link before I ever posted. I didn't see anything about truncating the title length. Did I miss something or is this just not possible?

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    Search the forum, truncating has been asked before...

    See here.
    http://wordpress.org/search/trim+title?forums=1

    I know i've at least answered such a question before.

  5. RenFromPenn
    Member
    Posted 2 years ago #

    I did search, but I didn't find anything specific to previous/next. Also, clicking the link that you provided resulted in this,

    "We couldn't find anything!

    Please try a different search."

    Since I don't know how to fix this, I did manage to put a workaround in place. This isn't really resolved, but I'm going to mark it as such.

  6. Mark / t31os
    Moderator
    Posted 2 years ago #

    From the link that was given...

    Showing 1–10 of 78 hits from wordpress.org and related

    Here's a couple..
    http://wordpress.org/support/topic/252007
    http://wordpress.org/support/topic/259338

    Ok, though, search page viewing problems aside, what specifically do you want to do, trim the post titles or something else. The mention of previous and next is confusing me since i was under the impression you just wanted to shorten the title, and i can't see how this related to the prev/next links...

    If you can't find a post related to what you want, please be specific about what you want to do exactly and i'll write something to trim the titles for you...

    ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.