Support » Fixing WordPress » Truncating topic title in sidebar only

  • Hi,

    I’m trying to create a theme that requires my sidebar widget for recent posts to be a certain width but obviously I’d like it to be able to account for posts with a longer title.

    What I’m trying to do is truncate the links shown in the sidebar widget to say 35 characters but not truncate the title itself on the post page which is what the truncate title plugin does.

    I just want to make the title link short in the sidebar widget.

    Anyone have any thoughts on how I can do this?

    Many thanks.

Viewing 1 replies (of 1 total)
  • Hi,

    Don’t know whether your going to find this useful now (March 09) but this maybe helpful for others.

    The only way I found to get round it is to ‘Hack’ the internal WordPress functions (not supported by WordPress since v1.5).

    You can achieve this by using PHPs substr function.

    I modified the functions adjacent_post_link & next_post_link to accept additional optional parameters to implement a truncate switch.

    It’s going to make it a pain to upgrade but oh well . . .


Viewing 1 replies (of 1 total)
  • The topic ‘Truncating topic title in sidebar only’ is closed to new replies.