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('« Previous Post: %link', '%title'); ?>
</div>
<div style="float: right;"><?php next_post_link('Next Post: %link »') ?></div>
</div>
Hi,
To manage next previous links..refer this article:
http://codex.wordpress.org/Next_and_Previous_Links
Thanks,
Shane G.
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?
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.
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.
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...
;)