Preset Widgets ONLY after site is initially created

Why not output your Theme’s custom Widgets using the_widget(), inside of a if ( ! dynamic_sidebar( ‘sidebar-name’ ) ) conditional? e.g. <?php if ( !dynamic_sidebar( ‘sidebar-right’ ) ) { $widgetsidebarrightargs = array( ‘before_widget’ => ‘<div class=”widget”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘<div class=”title widgettitle”>’, ‘after_title’ => ‘</div>’ ); the_widget(‘WP_Widget_Calendar’ , ‘title=” , $widgetsidebarrightargs ); the_widget( … Read more

Using theme options to change a border-radius value

Use standard echo or printf with additional parameters. e.g. if(isset($option[‘borderradius’]) && (!empty($option[‘borderradius’]))) { $borderradius=”.post { “; $borderradius .= ‘border-radius: ‘ . $option[‘borderradius’] . ‘px; ‘; $borderradius .= ‘-webkit-border-radius: ‘ . $option[‘borderradius’] . ‘px; ‘; $borderradius .= ‘-moz-border-radius: ‘ . $option[‘borderradius’] . ‘px; ‘; $borderradius .= ‘}’; echo $borderradius; } if(isset($option[‘borderradius’]) && (!empty($option[‘borderradius’]))) { printf(‘.post { … Read more