Title: widget code insert ??
Last modified: August 19, 2016

---

# widget code insert ??

 *  Resolved [michaelbleakley](https://wordpress.org/support/users/michaelbleakley/)
 * (@michaelbleakley)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/widget-code-insert/)
 * hello
 * where about do i insert the code in sidebar php to widgetise my theme?
 * i tryed inserting it at the begining it i was able to add widget but it moved
   the other widget to the other side of the page. do i need to insert it at the
   end ???
 * thank you!!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/widget-code-insert/#post-1520431)
 * See [Widgetizing_Themes](http://codex.wordpress.org/Widgetizing_Themes)
 *  Thread Starter [michaelbleakley](https://wordpress.org/support/users/michaelbleakley/)
 * (@michaelbleakley)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/widget-code-insert/#post-1520487)
 * thanks but it doesnt tell me where about in the sidbar php file to insert the
   code ? or have a missed it
 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/widget-code-insert/#post-1520492)
 * From the theme’s (as mentioned in another thread) unedited `sidebar.php` template
   file I would suggest:
    1. Line 2: `<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar() ):
       else : ?>`
    2. Line 39: `<?php endif; ?>`
 * See if that will work for you …
 *  Thread Starter [michaelbleakley](https://wordpress.org/support/users/michaelbleakley/)
 * (@michaelbleakley)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/widget-code-insert/#post-1520496)
 * thanks mate ill give it a go
 *  Thread Starter [michaelbleakley](https://wordpress.org/support/users/michaelbleakley/)
 * (@michaelbleakley)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/widget-code-insert/#post-1520641)
 * yeah it didnt work its enable the ability to use widgets but it moved the side
   bar content to the post area.
 * i give up this is to hard.
 *  Thread Starter [michaelbleakley](https://wordpress.org/support/users/michaelbleakley/)
 * (@michaelbleakley)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/widget-code-insert/#post-1520642)
 * This is how my sidebar php looks where about should i insert the code.
 * 1.Line 2: <?php if (function_exists(‘dynamic_sidebar’) && dynamic_sidebar() ):
   else : ?>
    2.Line 39: <?php endif; ?> thanks for taking a look and helping out….
 *     ```
       <div id="sidebar">
   
       <?php
       $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
       if ($children) { ?>
       <div class="box" id="category">
       <h2>Subpages</h2>
   
             <?php echo $children; ?> 
   
       </div>
       <?php } ?>
   
       <div class="box">
       <h2>Categories</h2>
   
             <?php wp_list_categories('categories_before=&categories_after=&title_li='); ?> 
   
       </div>
   
       <div class="box">
       <?php wp_list_bookmarks('categorize=0&category_before=&category_after=&title_li=Links'); ?>
       </div>
   
       <div class="box">
       <h2>Profil</h2>
   
           * <?php wp_register(); ?> <?php wp_loginout(); ?>
   
             <?php wp_meta(); ?> 
   
       </div>
   
       <div class="box" id="share">
       <img src="<?php bloginfo('template_url')?>/images/rss.jpg" alt="RSS feed" />
       <img src="<?php bloginfo('template_url')?>/images/facebook.jpg" alt="Facebook" />
       <img src="<?php bloginfo('template_url')?>/images/twitter.jpg" alt="Twitter" />
       </div>
   
       </div><!-- ======= sidebar END ======= -->
       ```
   
 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/widget-code-insert/#post-1520669)
 * ‘Line 2’ goes right after `<div id="sidebar">`
    ‘Line 39’ goes right before `
   </div><!-- ======= sidebar END ======= -->`

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘widget code insert ??’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [Edward Caissie](https://wordpress.org/support/users/cais/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/widget-code-insert/#post-1520669)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
