- This topic has 11 replies, 2 voices, and was last updated 4 years, 3 months ago by
Tom.
-
AuthorPosts
-
March 18, 2018 at 1:06 am #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!
GeneratePress 2.0.2GP Premium 1.5.6March 18, 2018 at 11:45 am #523169Tom
Lead DeveloperLead DeveloperHi 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 }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 18, 2018 at 12:46 pm #523205dynamohood
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
March 18, 2018 at 9:36 pm #523382Tom
Lead DeveloperLead DeveloperHmm, 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”?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 19, 2018 at 6:13 am #523600dynamohood
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!
JMarch 19, 2018 at 10:13 am #523833Tom
Lead DeveloperLead DeveloperSo do you want those single pages to have a sidebar, or no sidebar?
Let me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 19, 2018 at 11:13 am #523887dynamohood
No sidebars on Single Player and Single Match pages please! 🙂
March 19, 2018 at 8:35 pm #524222Tom
Lead DeveloperLead DeveloperIt’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; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 19, 2018 at 11:48 pm #524279dynamohood
Hi Tom
That did not seem to fix the problem either… 🙁
March 20, 2018 at 9:44 am #524683Tom
Lead DeveloperLead DeveloperI’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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 20, 2018 at 3:45 pm #524957dynamohood
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
March 20, 2018 at 8:27 pm #525042Tom
Lead DeveloperLead DeveloperThank you! I really appreciate that 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.