[Resolved] WP Club Manager

Home Forums Support [Resolved] WP Club Manager

Home Forums Support WP Club Manager

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #522814
    dynamohood

    i have added a plugin “WP Club Manager” and it has pushed the sidebar below content.

    They offer a fix but i have no idea how to correctly put it in place.

    Link to support fix: https://docs.wpclubmanager.com/article/64-third-party-theme-compatibility

    suggested code:

    By inserting a few lines in your theme’s functions.php file, First unhook the WP Club Manager wrappers;
    remove_action( ‘wpclubmanager_before_main_content’, ‘wpclubmanager_output_content_wrapper’, 10); remove_action( ‘wpclubmanager_after_main_content’, ‘wpclubmanager_output_content_wrapper_end’, 10);

    Then hook in your own functions to display the wrappers your theme requires;
    add_action(‘wpclubmanager_before_main_content’, ‘my_theme_wrapper_start’, 10); add_action(‘wpclubmanager_after_main_content’, ‘my_theme_wrapper_end’, 10);
    function my_theme_wrapper_start() { echo ‘<section id=”main”>’; }
    function my_theme_wrapper_end() { echo ‘</section>’; }

    Make sure that the markup matches that of your theme. If you’re unsure of which classes or ID’s to use take a look at your theme’s page.php for a guide.

    I cant get this to work for Generate Press

    Any help would greatly appreciated!

    #523169
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this:

    remove_action( 'wpclubmanager_before_main_content', 'wpclubmanager_output_content_wrapper', 10);
    remove_action( 'wpclubmanager_after_main_content', 'wpclubmanager_output_content_wrapper_end', 10);
    add_action( 'wpclubmanager_before_main_content', 'tu_wrapper_start', 10 );
    add_action( 'wpclubmanager_after_main_content', 'tu_wrapper_end', 10 ); 
    
    function tu_wrapper_start() { ?>
    	<div id="primary" <?php generate_content_class();?>>
    		<main id="main" <?php generate_main_class(); ?>>
    			<?php
    			/**
    			 * generate_before_main_content hook.
    			 *
    			 * @since 0.1
    			 */
    			do_action( 'generate_before_main_content' );
    			?>
    			<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'CreativeWork' ); ?>>
    				<div class="inside-article">
    					<?php
    					/**
    					 * generate_before_content hook.
    					 *
    					 * @since 0.1
    					 *
    					 * @hooked generate_featured_page_header_inside_single - 10
    					 */
    					do_action( 'generate_before_content' );
    					?>
    					<div class="entry-content" itemprop="text">
    					<?php
    }
    
    function tu_wrapper_end() { ?>
    					</div><!-- .entry-content -->
    					<?php
    					/**
    					 * generate_after_content hook.
    					 *
    					 * @since 0.1
    					 */
    					do_action( 'generate_after_content' );
    					?>
    				</div><!-- .inside-article -->
    			</article><!-- #post-## -->
    			<?php
    			/**
    			 * generate_after_main_content hook.
    			 *
    			 * @since 0.1
    			 */
    			do_action( 'generate_after_main_content' );
    			?>
    		</main><!-- #main -->
    	</div><!-- #primary -->
    <?php
    }
    #523205
    dynamohood

    Hi Tom

    Thanks for the really quick reply on this. I added that code to functions.php on my child theme but it has not fixed the problem.

    Here’s an example of one of the pages that has this issue:

    https://www.southwellcity.com/match/190-kimberley-mw-v-southwell-city/

    John

    #523382
    Tom
    Lead Developer
    Lead Developer

    Hmm, it seems the sidebar layout is set to no sidebars, but the sidebar is still displaying below the content.

    What’s your sidebar layout set to for single posts in “Customize > Layout > Sidebars”?

    #523600
    dynamohood

    It’s set as “no sidebars”.

    I found this extra info from the author that may help:

    For the most part, WP Club Manager templates will integrate nicely with most WordPress themes. Where you may run into problems is when the default WP Club Manager content wrappers do not match your chosen themes. This will manifest itself by breaking your layout on WP Club Manager pages and shifting your sidebars into incorrect positions.

    This problem can potentially affect the single player page and the single match page because WP Club Manager uses templates of its own to display these pages (and its impossible for WP Club Manager to know exactly what markup your theme uses).

    Thanks!
    J

    #523833
    Tom
    Lead Developer
    Lead Developer

    So do you want those single pages to have a sidebar, or no sidebar?

    Let me know 🙂

    #523887
    dynamohood

    No sidebars on Single Player and Single Match pages please! 🙂

    #524222
    Tom
    Lead Developer
    Lead Developer

    It’s surprising that it’s showing up at all.

    Let’s try adding this function:

    add_filter( 'generate_sidebar_layout', 'tu_disable_club_manager_sidebar' );
    function tu_disable_club_manager_sidebar( $layout ) {
        if ( is_singular( 'wpcm_match' ) ) {
            return 'no-sidebar';
        }
    
        return $layout;
    }
    #524279
    dynamohood

    Hi Tom

    That did not seem to fix the problem either… 🙁

    #524683
    Tom
    Lead Developer
    Lead Developer

    I’m not sure what WP Club Manager is doing, but it’s tricking the page into thinking it’s not a single post.

    You can do something simple, like this:

    .single-wpcm_match .sidebar {
        display: none;
    }

    It’s not pretty, but it will work.

    #524957
    dynamohood

    It may not be pretty but it worked so I am very pleased with that. 🙂

    I recommended your theme to a work colleague last week and he has now paid for the full version and is enjoying using it. I am glad I did now – your support has been great on my little issue, so thanks!

    J

    #525042
    Tom
    Lead Developer
    Lead Developer

    Thank you! I really appreciate that 🙂

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.