Here's another fix for sidebar issues in mobile

Hi all: I needed to disable my sidebar for mobile. The fix from a previous thread didn’t work but I figured out one that did. I’m not sure why the other fix didn’t work for me, it seemed to work for the others.

ANYways, I went into Appearance/Editor (from the dash), opened sidebar.php, and put the <?php x_get_view( x_get_stack(), 'wp', 'sidebar' ); ?> functions inside the <div class="x-visibility x-visible-desktop"> tags and it worked like a charm.

FWIW, I’m using the ICON stack and my site is here: http://elisabethparker.com/. I’m not sure why the original fix didn’t work for me, but I’m hoping this might be helpful to someone.

The final code for the whole shebang appears as follows:

<?php

// =============================================================================
// SIDEBAR.PHP
// -----------------------------------------------------------------------------
// Handles sidebar output for posts and pages.
//
// Content is output based on which Stack has been selected in the Customizer.
// To view and/or edit the markup of your Stack's pages, first go to "views"
// inside the "framework" subdirectory. Once inside, find your Stack's folder
// and look for a file called "wp-sidebar.php," where you'll be able to find
// the appropriate output.
// =============================================================================

?>

  <div class="x-visibility x-visible-desktop">
    <?php x_get_view( x_get_stack(), 'wp', 'sidebar' ); ?>
  </div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.