WordPress.org

Ready to get started?Download WordPress

Forums

Magazine Columns
header in column causes space (3 posts)

  1. webbmalin
    Member
    Posted 1 year ago #

    The plugin "magazine columns" works fine except 2 things:
    If I want a header, eg <h2> in top of column it adds an empty <p>-tag above it which creates extra space that I don't want.

    Is that my coding or is it the plugin?

    Also, the code doesn't validate with the plugin.

    http://wordpress.org/extend/plugins/magazine-columns/

  2. Peter Massey-Plantinga
    Member
    Posted 1 year ago #

    I've had these problems too.

    I fixed it by adding this to my code:

    function fix_columns( $content ) {
        $content = preg_replace( '/(<p>)?((<\/div>)?<div class="column c\d">)<\/p>/', '\2', $content );
    }
    add_filter( 'the_content', 'fix_columns' );

    Perhaps this can be added to the plugin?

  3. Peter Massey-Plantinga
    Member
    Posted 1 year ago #

    Sorry, bad code. Update:

    function fix_columns( $content ) {
        $content = preg_replace( '/(<p>)?((<\/div>)?<div class="column c\d">)<\/p>/', '\2', $content );
        return $content;
    }
    add_filter( 'the_content', 'fix_columns' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic