ThemeShaper Forums » Thematic


Q: displaying widget area properly

(2 posts)
  • Started 9 years ago by charlesolaes
  • Latest reply from middlesister
  • This topic is not resolved


  1. is there a specific way of displaying widget areas through thematic? In the widget-extensions.php there's a piece of code in the thematic_widget_init()

    $widgets_dir = @ dir(ABSPATH . '/wp-content/themes/' . get_stylesheet() . '/widgets');
    	  if ((TEMPLATENAME != THEMENAME) && ($widgets_dir)) {
    		  while(($widgetFile = $widgets_dir->read()) !== false) {
    			 if (!preg_match('|^\.+$|', $widgetFile) && preg_match('|\.php$|', $widgetFile))
    				  include(ABSPATH . '/wp-content/themes/' . get_stylesheet() . '/widgets/' . $widgetFile);

    so I created a file in my child theme dir 'widgets/file name' and it registered the widget area with no problem. Is there a specific way to display the widget area in home.php? or should I create a function and call the dynamic_sidebar(); and add_action to a thematic hook?


    Posted 9 years ago #
  2. middlesister

    You do know that there are already 13 predefined widgets areas in thematic? Maybe there already is one where you need it. Widget areas are not displayed unless there actually are widgets in them.

    The /widgets folder in your child theme is for dropping files containing actual widgets, not widget areas. A widget area like you guessed is best created in functions.php and added to thematic via a hook. Where do you want to add your widget area?

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.