Forums

[resolved] Can't Delete Unwanted Sidebar Widgets (4 posts)

  1. lawnsignmaker
    Member
    Posted 3 years ago #

    Hello,

    On my blog there is a number of sidebar widgets to the right. However, these are not active in the "widgets" section of the admin panel. I don't want them since they're just taking up space there, but I can't delete them from the admin panel.

    How can I fix that and delete the unwanted widgets?

    Thank you,
    LawnSignMaker

  2. vtxyzzy
    Member
    Posted 3 years ago #

    In the 'StudioPress' theme, the sidebar contents are hard-coded in sidebar.php. Save the original sidebar.php to sidebar-original.php, and use the code below as sidebar.php:

    <div id="allsidebars">
    
    <div class="sidebarswrapper"><div class="sidebars">
    
    <?php if (get_option('greeting') || get_option('welcomemessage')) {
      echo "<div id='welcome'>";
      if (get_option('greeting')) {
        echo "<h2>" . get_option('greeting') . "</h2>";
        }
      if (get_option('welcomemessage')) {
        echo "<p>" . get_option('welcomemessage') . "</p>";
        }
      echo "</div>";
      } else {
      echo "<div id='welcome'><h2>Welcome!</h2><p>To customize this message, please go to your Admin panel and find Presentation->Theme Options. Modify at will!</p></div>";
    }
    
    ?>
    
    <div class="sidebarsbottom"></div>
    </div> <!-- Closes Sidebars -->
    </div> <!-- Closes SidebarsWrapper -->
    
    <div class="sidebarsB">
    
    <div class="adsense_sidebar"><?php include (TEMPLATEPATH . '/adsense_sidebar336.php'); ?></div>
    
    <div class="sidebar1">
    <ul>
    
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar1') ) : ?>
    
    <?php endif; ?>
    
    </ul>
    
    </div> <!-- Closes Sidebar1 -->
    
    <div class="sidebar2">
    
    <ul>
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar2') ) : ?>
    
    <?php endif; ?>
    </ul>
    
    </div> <!-- Closes Sidebar2 -->
    <div class="cleared"></div>
    </div> <!-- Closes SidebarsB -->
    
    </div> <!-- Closes allsidebars -->

    This has been tested only a little!

  3. lawnsignmaker
    Member
    Posted 2 years ago #

    Thanks! It seems to be working.

    Did you do this yourself or is this a known problem with studio-press theme?

  4. vtxyzzy
    Member
    Posted 2 years ago #

    Well, there may be an easier way, but this is ny own hack. Now, please use the dropdown at top right to mark this topic 'Resolved'.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.