WordPress.org

Ready to get started?Download WordPress

Forums

Cut off long URL's in comments? (7 posts)

  1. JPigford
    Member
    Posted 9 years ago #

    I noticed there here on the boards, long URL's get cut off instead of break the layout...just wondering how to do that in the comments section of my site.

    Like this:
    http://www.example/page1/page2/page3/super/duper/long/url/blah/blah/blah.php

  2. Cypher
    Member
    Posted 9 years ago #

    This might help.

    thread .post {
    overflow: hidden;
    width: 100%;

    Regards

  3. JPigford
    Member
    Posted 9 years ago #

    Doh, I don't know why I didn't think of that...

  4. tsguitar
    Member
    Posted 9 years ago #

    This doesn't work with IE, though...

  5. Kafkaesqui

    Posted 9 years ago #

    "This doesn't work with IE, though..."

    A lot of things don't. Try playing with the width value, that is set it to something less than 100%, or provide an exact pixel width.

  6. tsguitar
    Member
    Posted 9 years ago #

    True. I'm just letting folk know that the overflow: hidden doesn't work in IE. A lot of things don't work in IE, but a lot of our visitors use IE and we have to keep that browser in mind. Setting the width value didn't get me what I wanted, so I just removed the "/"s from any URLs so that the line could break somewhere convenient. I'm using a recent comments plug in:
    http://mtdewvirus.com/

    I changed:
    $words = split(" ",$comment_content);

    to:
    $words = split("[ /]",$comment_content);

    So now it's looking for a space or for "/" to count as the character between words. This has its drawbacks and I'd do better to install a proper plug in. It's on my list of things to-do (research, research, research for the right plug in!); this fix worked for now.

  7. Kafkaesqui

    Posted 9 years ago #

    If you don't mind a hacky plugin solution (hacky in the sense I've never been happy with it, but it works for the most part)...

    http://wordpress.org/support/topic/20778#post-119124

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.