Jump to content
Sign in to follow this  
georgeadwizbiz

How to truncate post title on pagination?

Recommended Posts

georgeadwizbiz

I want to truncate the post titles on the previous post and next post links in PlatformPro post-nav area at the top of single posts, but can't find how you build the previous_post_link and next_post_link content in the section.postnav.php file. Can you direct me to where I would add the truncate_post function so that I can shorten that text? I find that many titles are so long they cause the bar to divide into two lines, one for the left and one for the right side. This was smart on the part of Pagelines development, but I would prefer to force it to always be one line and just need some help directing me to where I would insert my additional PHP code.

Share this post


Link to post
Share on other sites
cmunns

You could set a max-width using CSS, that would be much easier than truncating with PHP. ` .post-nav .next a, .post-nav .previous a { max-width:250px; } `

Share this post


Link to post
Share on other sites
georgeadwizbiz

It works, but of course forces two or more lines, so it doesn't look as clean. I would prefer to see:

<- Nearing Production on Recently Drilled...
Rather than:
<- Nearing Production on Recently Drilled
	California Natural Gas Well

But it does the job, and if I specify less line height it looks cleaner. Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×