BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › page with own styling
- This topic has 8 replies, 3 contibutors, and was last updated 8 years, 9 months ago by Andre.
Question
February 9, 2016 at 3:32 pm #58711@gimmediaHi, i want to create one page, one my site using boss theme, with other styling for a running campaign. I refer to my own stylesheet, but somehow the boss css and javascripts are overruling this. I placed all new files into child theme. Any help is much appreciated.
Answers
February 10, 2016 at 3:01 am #58758@
AnonymousHi @gimmedia
First you need to check all handle your need removehttps://wordpress.org/plugins/debug-bar/
List all handle and add theme as following
I have used a sample handle name to demonstrateand you can wrap action which conditional logic with corresponding page id
/** * Dequeue the Parent Theme scripts. * * Hooked to the wp_print_scripts action, with a late priority (100), * so that it is after the script was enqueued. */ function bb_dequeue_boss_script() { wp_dequeue_script( 'comment-reply' ); //If you're using disqus, etc. wp_dequeue_script( 'jquery_ui' ); //jQuery UI, no thanks! wp_dequeue_script( 'fancybox' ); //Nah, I use FooBox wp_dequeue_script( 'wait_for_images' ); wp_dequeue_script( 'jquery_easing' ); wp_dequeue_script( 'swipe' ); wp_dequeue_script( 'waypoints' ); } add_action( 'wp_print_scripts', 'bb_dequeue_boss_script', 100 ); /** * Dequeue the Parent Theme styles. * * Hooked to the wp_enqueue_scripts action, with a late priority (100), * so that it runs after the parent style was enqueued. */ function bb_dequeue_theme_css() { wp_dequeue_style('additional-parent-style'); wp_deregister_style('additional-parent-style'); } add_action('wp_enqueue_scripts','bb_dequeue_theme_css', 100);
Regards
Varun DubeyFebruary 10, 2016 at 4:37 am #58783@gimmediaThanks Varun, but how do I wrap this action which conditional logic with corresponding page id? Because I have only a specific page which needs to be excluded. Can I put this also in the header or footer?
February 10, 2016 at 4:54 am #58786@gimmediaMy page ID is 3013, is this the right way to disable buddyboss css?
add_action( 'wp_print_styles', 'deregister_buddyboss_styles', 3013 ); function deregister_buddyboss_styles() { wp_deregister_style( 'boss-main-desktop-css' ); wp_deregister_style( 'boss-main-global-css' ); }
February 10, 2016 at 6:00 am #58794@
AnonymousHi @gimmedia,
You can add like this
Conditional logic only for the actions.
You can use your developer to do these edits and create custom template for you.The handle i have used is symbolic you need to cross check with debug plugin which i have mentioned above to removed on the basis of your requirement.
<?php function bb_dequeue_boss_script() { wp_dequeue_script( 'comment-reply' ); //If you're using disqus, etc. wp_dequeue_script( 'jquery_ui' ); //jQuery UI, no thanks! wp_dequeue_script( 'fancybox' ); //Nah, I use FooBox wp_dequeue_script( 'wait_for_images' ); wp_dequeue_script( 'jquery_easing' ); wp_dequeue_script( 'swipe' ); wp_dequeue_script( 'waypoints' ); } function bb_dequeue_theme_css() { wp_dequeue_style('additional-parent-style'); wp_deregister_style('additional-parent-style'); } if ( is_page( 3013 ) ) { add_action( 'wp_print_scripts', 'bb_dequeue_boss_script', 100 ); add_action('wp_enqueue_scripts','bb_dequeue_theme_css', 100); } ?>
Regards
February 10, 2016 at 6:59 am #58818@gimmediado I put this in the child theme or main boss theme?
February 14, 2016 at 11:04 pm #59205@
AnonymousHi @gimmedia, Please put all the edits in your child theme (just to preserve your custom work)
REgards
February 15, 2016 at 1:45 am #59233@gimmediaHi, thanks. I have a problem with the debug-bar, since admin bar is not showing on my page. Can you provide a list of things to disable Boss theme completely from a page I am missing? I tried to exclude the following, but still all is loaded. I placed the code below in the child-theme functions.php and the test page I’m using has ID 3013.
<?php function bb_dequeue_boss_script() { wp_dequeue_script( 'buddyboss' ); } function bb_dequeue_theme_css() { wp_dequeue_style('boss-main-global-css'); wp_deregister_style('boss-main-global-css'); wp_dequeue_style('boss-main-desktop-css'); wp_deregister_style('boss-main-desktop-css'); wp_dequeue_style('boss-main-mobile-css'); wp_deregister_style('boss-main-mobile-css'); } if ( is_page( 3013 ) ) { add_action( 'wp_print_scripts', 'bb_dequeue_boss_script', 100 ); add_action('wp_enqueue_scripts','bb_dequeue_theme_css', 100); } ?>
February 20, 2016 at 1:14 pm #59800@gimmediaany help is much appreciated! 😉
- The question ‘page with own styling’ is closed to new replies.