WP Conditional To Hide Sidebar
-
Hi everyone,
I’m currently working with the Tutor LMS plugin and I’m trying to target certain pages to hide the sidebar switcher. The challenge I’m facing is that these pages don’t have specific IDs.
Can anyone guide me on how to obtain the IDs, taxonomy, or templates for these pages and then hide them?
When I inspect the page, I see this class:
courses-template-default single single-courses postid-93 logged-in admin-bar custom-background theme-Divi et-tb-has-template et-tb-has-footer tutor-lms tutor-frontend woocommerce-js et_button_no_icon et_pb_button_helper_class et_fullwidth_nav et_fixed_nav et_show_nav et_primary_nav_dropdown_animation_fade et_secondary_nav_dropdown_animation_fade et_header_style_left et_cover_background et_pb_gutter osx et_pb_gutters3 et_right_sidebar et_divi_theme et-db customize-support sticky-menu chrome woocommerce-multi-currency-ARSNow, I want to achieve the following:
!is_page(array(166, 193, 164, 46, 78, 159)) || !is_singular('single-courses')Can someone help me figure out how to achieve this?
Thanks in advance!
The page I need help with: [log in to see the link]
-
Hi,
Thank you for kindly waiting.
We have a general instruction for conditional tag. You can visit this one: https://villatheme.com/knowledge-base/conditional-tags/
For IDs, you can see it here: https://prnt.sc/qMLjFLbMtRaZ
Best regards.
Thanks for your reply. I did not find the solution there. I ended up using a jquery custom code:
<script>
$(document).ready(function(){ // Check if body has class 'single-lesson' if ($('body').hasClass('single-lesson')) { // Hide element with class '.woocommerce-multi-currency.wmc-sidebar.wmc-right' $('.woocommerce-multi-currency.wmc-sidebar.wmc-right').hide(); } });
</script>-
This reply was modified 2 years ago by
Augusto Gentile.
-
This reply was modified 2 years ago by
Augusto Gentile.
Thank you for the updates. I’m glad to hear you found the solution.
-
This reply was modified 2 years ago by
The topic ‘WP Conditional To Hide Sidebar’ is closed to new replies.