0

I have a theme that automatically adds some widgets. I don't want them and so I tried to edit the Sidebar.php but it just fails and sends me to a page with message 404. Here's the code block I am trying to delete from Sidebar.php:

<!-- sidebar south START -->
<div id="southsidebar" class="sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('south_sidebar') ) : ?>

    <!-- archives -->
    <div class="widget">
        <h3>Archives</h3>
        <?php if(function_exists('wp_easyarchives_widget')) : ?>
            <?php wp_easyarchives_widget("mode=none&limit=6"); ?>
        <?php else : ?>
            <ul>
                <?php wp_get_archives('type=monthly'); ?>
            </ul>
        <?php endif; ?>
    </div>

    <!-- meta -->
    <div class="widget">
        <h3>Meta</h3>
        <ul>
            <?php wp_register(); ?>
            <li><?php wp_loginout(); ?></li>
        </ul>
    </div>

<?php endif; ?>
</div>
<!-- sidebar south END -->

EDIT: So for now what I have done is I modified the css to hide southsidebar. But actually I want to use that div by adding other widgets.

5
  • can't you just delete the code between <div id="southsidebar" class="sidebar"> the code block </div> and add your other widget that you want? Commented Jul 19, 2012 at 21:10
  • @Pontus I started with that but it is not letting me delete anything or even not commenting out.
    – oms
    Commented Jul 19, 2012 at 21:16
  • 2
    where are you editing the file "sidebar.php" ? in the wordpress admin? or via FTP with an external editor? Commented Jul 19, 2012 at 21:19
  • @Ludovic Wordpress editor....
    – oms
    Commented Jul 19, 2012 at 21:42
  • @Ludovic I was able to edit that page directly from my host's file editor. Thanks.
    – oms
    Commented Jul 19, 2012 at 21:50

2 Answers 2

1

Those widgets are added because you've specified none

Try adding a text widget with no content but spaces, you'll find all those hardcoded default 'widgets' dissappear

You should never use the built in editor in WordPress though, so use FTP/Shell/VCS instead

2
  • Good trick. Unfortunately that still leave me with an empty side-bar with borders. And my problem of modifying via editor still remains.
    – oms
    Commented Jul 19, 2012 at 21:52
  • Well you should never use the editor in the backend of WordPress. Use FTP instead
    – Tom J Nowell
    Commented Jul 20, 2012 at 11:43
0
<!-- sidebar south START -->
<div id="southsidebar" class="sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('south_sidebar') ) : ?>

Insert yours widgets code here

<?php endif; ?>
</div>
<!-- sidebar south END -->

File Permissions To edit a file through the Built-in Editor, the permissions for that file must be set to 666. You can change the permissions on files by using a FTP client program, web-based interface provided by your host, or from the command-line using telnet or ssh (secure shell). These options are dependent on the type of access your host offers.

2
  • I tried changing the Premission but after doing that it won't even load up the theme editor page. I am able to update Styles.css but no the sidebar.php. Both has same permission 644.
    – oms
    Commented Jul 19, 2012 at 21:40
  • Also the document you pointed says: Note that if a file is not writeable the Update File button will not be available. But I can see the button and click it. There error shows up after that.
    – oms
    Commented Jul 19, 2012 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.