WordPress.org

Ready to get started?Download WordPress

Forums

Visitor Maps and Who's Online
Minor Code Tweak to Facilitate CSS (8 posts)

  1. fwchapman
    Member
    Posted 3 years ago #

    Hi Mike,

    One of the themes I use does not display the widget statistics the way I'd like. It wasn't indenting the stats at all, which didn't look right. It's a quirk of the theme, which has the same problem with some other widgets, too.

    I figured out how to fix this with CSS, but I ran into some limitations related to the use of <br /> to start a new line. It turns out to be better, from a CSS standpoint, to use </p><p> instead of <br /> to start a new line. That way, CSS has something to grab onto for each line if you want to control the indentation.

    I edited my copy of the plugin to replace <br /> with </p><p> everywhere in the function

    visitor_maps_widget_content()

    I was then able to use this CSS to indent the stats:

    #visitor-maps p:before {content: "   ";}

    Those are hard spaces inside the quotes. Ordinary spaces won't work.

    Would you consider making this tiny code tweak in a future release of the plugin? That would be a big help to people who want to use CSS to style the output of the plugin.

    Thank you,

    Fred Chapman
    [ Signature moderated. ]

    http://wordpress.org/extend/plugins/visitor-maps/

  2. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    I tried it and the margin between lines got bigger. So I am not wanting to change it or others will complain about that.

  3. fwchapman
    Member
    Posted 3 years ago #

    Thanks for trying out my suggestion, Mike! Instead of using <p></p> pairs, what about trying <div></div> pairs? They don't seem to add extra vertical spacing. Could that be a solution which makes everybody happy? -Fred

  4. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    Divs seem to work. I can try it for the next version to be out soon.

    Mike

  5. fwchapman
    Member
    Posted 3 years ago #

    That's fantastic! Thanks so much, Mike!!

    Fred

  6. fwchapman
    Member
    Posted 3 years ago #

    Hi Mike,

    I tried out the new version with the <div> tags. There are five places in the code which have

    <div></div>

    when it should actually be

    </div><div>

    I made the corrections in my copy. I added this to my style.css file

    #visitor-maps div:before {content: "   ";}

    and the indentations work perfectly now.

    We're making progress! :)

    Thanks,

    Fred

  7. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    I just updated the trunk code.
    Thanks

    Mike

  8. fwchapman
    Member
    Posted 3 years ago #

    Mike,

    I appreciate your super-speedy response! Thanks for fixing this so quickly.

    Fred

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic