WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] can I use hard coding and widgets? (3 posts)

  1. jaw23
    Member
    Posted 4 years 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!

  2. 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.

  3. jaw23
    Member
    Posted 4 years ago #

    brilliant! much simpler than what I was trying to do. thanks so much. and thanks for such a quick response!

Topic Closed

This topic has been closed to new replies.

About this Topic