Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Bonus points for being a ‘Padding-Margin Crusher-Ninja”

  • This topic is empty.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #44223
    Crssp
    Participant

    I can’t figure out what’s creating the padding at the top of the main content area above the Latest News Ticker.

    http://tinyurl.com/bv45hdu

    Wordpress Twenty Twelve theme has a bit of Class-itis me thinks, but it’s the theme plugged in at the moment (not a fan).
    Trying to eliminate the space above and below the ticker, besides the ticker itself having padding properties, etc. I think it’s the theme attributes giving me troubles though.

    I’ve tried 20 or more smackdown methods, nothings working. :(

    #132342
    wolfcry911
    Participant

    line 579

    .site-content {
    margin: 1.71429rem 0 0;
    }

    #132343
    ChrisP
    Participant

    @Crssp, my first guess is the empty `p` tags and line breaks you have in the page.

    #132344
    TheDoc
    Member

    @ChrisP hit the nail on the head. There’s an empty `

    ` tag sitting there: http://cl.ly/image/0q2B3h0J2r2W

    #132347
    ChrisP
    Participant

    @Crssp, giving your `

    ` tags a `display: none;` value will leave you with 0 content..aside from that, @TheDoc’s screenshot shows that the problem is your ticker is _inside_ a `

    ` tag, which would make your ticker disappear completely.

    > It could be the ditty news scroll plugin tossing in the p tags, if it’s even that tough. Thanks again.

    It’s someone getting “return happy” in the visual editor of WP..just switch it to HTML and delete excess `p` and `br` tags.

    #132350
    ChrisP
    Participant

    > Aware of the p display none it was a joke.

    Glad to hear it..lol sarcasm is hard to read

    #132352
    Crssp
    Participant

    Anybody have a suggested fix for WordPress adding P tags, especially when it’s the first thing in the editor?
    First google brought me to this functions file snippet:

    http://sww.co.nz/solution-to-wordpress-adding-br-and-p-tags-around-shortcodes/

    Really not sure now.

    #132354
    Crssp
    Participant

    Never had a use for:

    p:first-child rule
    …but that’s a thought, even though the p tag shouldn’t be there.

    #132356
    Crssp
    Participant

    @ChrisP> It’s someone getting “return happy” in the visual editor of WP..just switch it to HTML and delete excess p and br tags.
    The P tags are not there, in the html view, they are getting parsed in some how, whether it’s js of the plugin or just WP auto P’s….

    #132357
    ChrisP
    Participant

    @Crssp, I think the link you had earlier is the ticket.

    > http://sww.co.nz/solution-to-wordpress-adding-br-and-p-tags-around-shortcodes/

    I don’t really make much use of shortcodes so I don’t have much experience..

    I think your `:first-child` option could be a possibility too. The only problem is the pages that _don’t_ have a shortcode would be affected too. You could always add a body class..like `.home` for this page, then target the shortcode using `.home .entry-content p:first-child { margin: 0 }`

    That would definitely be a hack-y solution though..

    #132362
    Crssp
    Participant

    Thanks again ChrisP, I’m hesitant to do anything with the functions.php on this one, not entirely understanding the overall results.
    Attempting the hack-y CSS still no love. :(

    #133164
    Crssp
    Participant

    This problem reared it’s ugly head on another project… found a fix this time via a Functions file php body blow to the mid-section:http://www.simonbattersby.com/blog/2011/02/wordpress-wrapping-shortcodes-with-p-tags/

    Setting up Post Snippets for Grid Columns in the venerable Skelton Theme from simplethemes, and this worked a charm!

    function simonbattersby_shortcode_format($content){
    $content = preg_replace(‘/(

    )s*( $content = preg_replace(‘/()s*(

    )/’, ‘‘, $content);
    return $content;
    }

    add_filter(‘the_content’,’simonbattersby_shortcode_format’,11);

    #133167
    Crssp
    Participant

    Wait a minute, now I’m getting break tags instead of the p opening tag, and a break for the P closing tag. :(
    So I’m still rattling on here… :(

Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘CSS’ is closed to new topics and replies.