Support » Plugins and Hacks » [Resolved] can I use hard coding and widgets?
6 years, 8 months ago
Is it possible to add widgets in conjunction with hard code in a sidebar.php? If so, please share a sample coding. Many thanks!
It’s not that hard to do exactly that. Look at wp-content/themes/default/sidebar.php around line 9. It should read
<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
That’s where the widgets get displayed. You can put your PHP coded above or below there.
NOTE: Make a copy of the theme in a new directory and don’t edit the default theme directly.
brilliant! much simpler than what I was trying to do. thanks so much. and thanks for such a quick response!