Anonymous
Unregistered
Posted 7 years ago #
Hi!
I've got get_recent_posts set up on my page, in the same area of the menu where the "categories" and other links are.
The problem I am having is that often my post titles are long and so in the "Recent Posts" section they wrap, and take up 2 or 3 lines. I'd like to be able to have it display just the first X characters, or first Y groups of characters (i.e. words).
Is there any way to to that?
Thank you!
Anne
shedevil
Member
Posted 7 years ago #
Oops..sorry! I wasn't logged in...I'm really not an anonymous coward, that above post was from me.
Thanks.
Anne
Joshua Sigar
Member
Posted 7 years ago #
Where do you get that function get_recent_posts from. You could always modify the source code.
If it's the plugin, you can modify. I set the length to 3 words....
http://mtdewvirus.com/wp-hacks/
I believe it's one from there.....
shedevil
Member
Posted 7 years ago #
It is one from http://mtdewvirus.com/wp-hacks/ <--there...and if someone could please tell me how to modify it I'd be forever grateful! (I'm looking at the code now but it's non-obvious.)
Thanks!
shedevil
Member
Posted 7 years ago #
Cypher...thank you thank you Thank You THANK YOU!!!!
Oh, and I just learned to never just cut and paste code from a webpage right into PHP..those invisible line feeds will get you every time. :-) I hand ported each line individually. Works a treat.
THANK YOU!!!
Anne
You're welcome. I had to add some extra whitespace in the code to make it show up as code as opposed to being interpreted as HTML syntax. So porting by hand is best. :)
Regards