Forums

Limiting text length on menu bar? (8 posts)

  1. 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

  2. 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

  3. Joshua Sigar
    Member
    Posted 7 years ago #

    Where do you get that function get_recent_posts from. You could always modify the source code.

  4. midori
    Member
    Posted 7 years ago #

    If it's the plugin, you can modify. I set the length to 3 words....

  5. Mark (podz)
    Support Maven
    Posted 7 years ago #

    http://mtdewvirus.com/wp-hacks/
    I believe it's one from there.....

  6. 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!

  7. 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

  8. Cypher
    Member
    Posted 7 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.