• Resolved jason1984

    (@jason1984)


    Hi everyone, I’m trying to remove the sidebar from my MH Magazine Lite theme (below the php I view). Can anyone provide me with the correct php to completely remove the sidebar?

    
    <aside class="mh-widget-col-1 mh-sidebar" itemscope="itemscope" itemtype="https://schema.org/WPSideBar"><?php
    	if (is_active_sidebar('sidebar')) {
    		dynamic_sidebar('sidebar');
    	} else { ?>
    		<div class="mh-widget mh-sidebar-empty">
    			<h4 class="mh-widget-title">
    				<span class="mh-widget-title-inner">
    					<?php esc_html_e('Sidebar', 'mh-magazine-lite') ?>
    				</span>
    			</h4>
    			<div class="textwidget">
    				<?php printf(esc_html__('Please navigate to %1s in your WordPress dashboard and add some widgets into the %1s widget area.', 'mh-magazine-lite'), '<strong>' . __('Appearance → Widgets', 'mh-magazine-lite') . '</strong>', '<em>' . esc_html__('Sidebar', 'mh-magazine-lite') . '</em>'); ?>
    			</div>
    		</div><?php
    	} ?>
    </aside>
    
    • This topic was modified 8 years, 3 months ago by Jan Dembowski. Reason: Fixed code block
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Jason,

    thanks for using MH Magazine lite.

    You could simply hide the sidebar with some CSS, for example:

    .single-post .mh-sidebar { display: none; }
    .single-post .mh-content { width: 100% !important; }

    When it comes to CSS customizations, you can always use tools like Firebug or your browsers inspection tool to inspect the elements on your site and then add your own CSS code based on your personal requirements.

    To apply custom CSS, you could either create a custom child theme or use plugins to add custom CSS code to your website.

    As an alternative you could have a look at the premium version of MH Magazine which includes an option to globally disable the sidebar, among several other features, options and custom widgets to customize your website.

    Thread Starter jason1984

    (@jason1984)

    Hi, I’ve added the CSS code you provided (please see screenshotscreenshot) but my site https://www.aliribelli.com still shows sidebar ??

    Please have a look at the provided code, it just was an example. When you look at the CSS class, you’ll notice that the code is supposed to work on posts and when you look at your posts, you’ll notice that the sidebar is gone.

    You may of course change the provided code as you like based on your personal needs and requirements. If you want to hide the sidebar on your Posts page (Blog), you could add for example:

    .blog .mh-sidebar { display: none; }
    .blog .mh-content { width: 100% !important; }

    Please use inspection tools as suggested in the previous reply in case you want to apply further CSS modifications.

    Thread Starter jason1984

    (@jason1984)

    Thank you, problem solved! Hooray ??

    Is there a way to disable the right single sidebar on all posts and pages, only for mobile but not desktop? It shows below everything on mobile and makes each page long to scroll. Looks fine on desktop.

    @admindroidturf: What you have in mind isn’t possible out of the box. But you could of course do something like:

    @media screen and (max-width: 767px) {
        .mh-sidebar { display: none; }
    }

    By the way, you’re using the premium version of MH Magazine on your website. These forums are for free themes that are hosted on www.remarpro.com and commercial themes are not supported here. If you have a question about your WordPress theme, you can send a support request through your MH Themes account.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove sidebar from theme’ is closed to new replies.