• Resolved lisajwells

    (@lisajwells)


    Just updated my parent theme to Version 1.8.

    In my child theme, I’ve got a custom loop for one of my page templates that displays all posts in a certain Category.

    <?php if ( is_page( 'white-collar-healthcare-pharmaceutical' )) {
        if ( $healthcare_query->have_posts() ) : while ( $healthcare_query->have_posts() ) : $healthcare_query->the_post(); ?>
    
    <h3><a id="notable-<?php the_ID(); ?>"></a><?php  the_title();  ?></h3>
    
    <?php if ( has_tag( 'explanation-notables' )) { ?>
        <div class="explanation">
        <?php the_content(); ?>
        </div>
        <?php } else {
        the_content();
    } ?>
    
    <?php endwhile; ?>
    <?php wp_reset_postdata();
    else : ?>
    <?php get_template_part( 'no-results' ) ?>
    <?php endif; // end the loop
    
    }?><!-- is_page -->

    Since the update, empty containers are added between the posts. They have no height, so they’re invisible on the page, except between the 2nd and 3rd posts, where there’s a big gap now. Here’s a screenshot of my page where you can see the resulting gap in the posts:
    https://grab.by/OhEm

    Or a link to the development site, where you can see it in action:
    https://dev.kousouroslaw.com/notable-cases/racketeering-bribery/

    It seems that this is coming from functions in the theme-functions.php: xsbf_add_container and xsbf_end_container.

    Do you think I can safely delete these functions in the parent theme? Or even better, turn them off somehow in the functions.php of my child theme?

    Thanks so much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lisajwells

    (@lisajwells)

    It is possible to remove these functions in the child theme like so:

    //Remove a function from the parent theme
    function remove_parent_filter(){ //Have to do it after theme setup, because child theme functions are loaded first
       remove_filter( 'the_content', 'xsbf_add_container', 5, 1 );
       remove_filter( 'the_content', 'xsbf_end_container', 1999, 1 );
    }
    add_action( 'after_setup_theme', 'remove_parent_filter' );
    Theme Author Tim Nicholson

    (@timnicholson)

    Yes, you can remove those filters. lisajwells advice is good. The specific filters you would want to remove are xsbf_add_container and xsbf_end_container.

    What I’m doing is trapping plugins that produce “after content”, such as social sharing icons, and moving them down to the bottom of the page. In v1.8 I got a little too aggressive with that. I quickly release v1.8.1 to set it back to what it was. Just today I released a major code update with v1.9 and think I have the problem solved for good. Let me know!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Version 1.8 new function leaving gap in post listing’ is closed to new replies.