Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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? –  Pontus Abrahamsson Jul 19 '12 at 21:10
    
@Pontus I started with that but it is not letting me delete anything or even not commenting out. –  oms Jul 19 '12 at 21:16
2  
where are you editing the file "sidebar.php" ? in the wordpress admin? or via FTP with an external editor? –  Tribalpixel Jul 19 '12 at 21:19
    
@Ludovic Wordpress editor.... –  oms Jul 19 '12 at 21:42
    
@Ludovic I was able to edit that page directly from my host's file editor. Thanks. –  oms Jul 19 '12 at 21:50
add comment

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
    
Good trick. Unfortunately that still leave me with an empty side-bar with borders. And my problem of modifying via editor still remains. –  oms Jul 19 '12 at 21:52
    
Well you should never use the editor in the backend of WordPress. Use FTP instead –  Tom J Nowell Jul 20 '12 at 11:43
add comment
<!-- 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.

share|improve this answer
    
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 Jul 19 '12 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 Jul 19 '12 at 21:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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