Title: PHP Code don&#8217;t work
Last modified: March 16, 2017

---

# PHP Code don’t work

 *  Resolved [studiol](https://wordpress.org/support/users/studiol/)
 * (@studiol)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-code-dont-work/)
 * Hello,
    I place the Widget PHP Code <?php widgets_on_template(“wop_1”); ?> in
   my page or header template, but the only code I see in the source-code of my 
   homepage is an empty list
 *  in the widget area.
 * <div id=’wop_1′ class=’widgets_on_page’>
 *  </div><!– widgets_on_page –>

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

 *  Plugin Author [toddhalfpenny](https://wordpress.org/support/users/toddhalfpenny/)
 * (@toddhalfpenny)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-code-dont-work/#post-8924982)
 * Hey [@studiol](https://wordpress.org/support/users/studiol/),
 * Sorry to hear you’re having trouble.
    Would you please double check the Sidebar
   setting to see which widget you’re trying to use, and also check that the shortcode
   is set as specified in the sidebar?
 * Ta,
    Todd
 *  Thread Starter [studiol](https://wordpress.org/support/users/studiol/)
 * (@studiol)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-code-dont-work/#post-8964356)
 * Hi Todd,
    thanks for your answer. My problem isn’t the widget-sidebar or the 
   backend-shortcode. I try to write the code directly in the PHP-header or -footer
   template.
 * <?php widgets_on_template(“wop_1”); ?>
 * Sincerely
    Oliver
 *  Plugin Author [toddhalfpenny](https://wordpress.org/support/users/toddhalfpenny/)
 * (@toddhalfpenny)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/php-code-dont-work/#post-8967292)
 * Yes, I think I got that [@studiol](https://wordpress.org/support/users/studiol/),
   apologies if I was not clear.
    From the look of your first post it seems your
   shortcode is being caught by the plugin and is trying to output some widgets.
 * What you need to do, for Widgets to appear on your page, is to add Widgets to
   the sidebar, via the normal widgets admin screen. The plugin will have add an
   extra sidebar for you to use. Do you see this?

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

The topic ‘PHP Code don’t work’ is closed to new replies.

 * ![](https://ps.w.org/widgets-on-pages/assets/icon.svg?rev=1400727)
 * [Widgets on Pages](https://wordpress.org/plugins/widgets-on-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widgets-on-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widgets-on-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/widgets-on-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widgets-on-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widgets-on-pages/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 3 replies
 * 2 participants
 * Last reply from: [toddhalfpenny](https://wordpress.org/support/users/toddhalfpenny/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/php-code-dont-work/#post-8967292)
 * Status: resolved