function thematic_widgets_init()
{
    // Define array for the widgetized areas
    $thematic_widgetized_areas = array('Header Widgets' => array('admin_menu_order' => 100, 'args' => array('name' => 'Header Widgets', 'id' => 'hdr-widgets', 'description' => __('The header widget area for additional mast head items.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_header', 'function' => 'thematic_widget_header', 'priority' => 10), 'Primary Aside' => array('admin_menu_order' => 200, 'args' => array('name' => 'Primary Aside', 'id' => 'primary-aside', 'description' => __('The primary widget area, most often used as a sidebar.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_primary_aside', 'function' => 'thematic_primary_aside', 'priority' => 10), 'Secondary Aside' => array('admin_menu_order' => 300, 'args' => array('name' => 'Secondary Aside', 'id' => 'secondary-aside', 'description' => __('The secondary widget area, most often used as a sidebar.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_secondary_aside', 'function' => 'thematic_secondary_aside', 'priority' => 10), '1st Subsidiary Aside' => array('admin_menu_order' => 400, 'args' => array('name' => '1st Subsidiary Aside', 'id' => '1st-subsidiary-aside', 'description' => __('The 1st widget area in the footer.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_subsidiaries', 'function' => 'thematic_1st_subsidiary_aside', 'priority' => 30), '2nd Subsidiary Aside' => array('admin_menu_order' => 500, 'args' => array('name' => '2nd Subsidiary Aside', 'id' => '2nd-subsidiary-aside', 'description' => __('The 2nd widget area in the footer.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_subsidiaries', 'function' => 'thematic_2nd_subsidiary_aside', 'priority' => 50), '3rd Subsidiary Aside' => array('admin_menu_order' => 600, 'args' => array('name' => '3rd Subsidiary Aside', 'id' => '3rd-subsidiary-aside', 'description' => __('The 3rd widget area in the footer.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_subsidiaries', 'function' => 'thematic_3rd_subsidiary_aside', 'priority' => 70), 'Index Top' => array('admin_menu_order' => 700, 'args' => array('name' => 'Index Top', 'id' => 'index-top', 'description' => __('The top widget area displayed on the index page.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_index_top', 'function' => 'thematic_index_top', 'priority' => 10), 'Index Insert' => array('admin_menu_order' => 800, 'args' => array('name' => 'Index Insert', 'id' => 'index-insert', 'description' => __('The widget area inserted after x posts on the index page.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_index_insert', 'function' => 'thematic_index_insert', 'priority' => 10), 'Index Bottom' => array('admin_menu_order' => 900, 'args' => array('name' => 'Index Bottom', 'id' => 'index-bottom', 'description' => __('The bottom widget area displayed on the index page.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_index_bottom', 'function' => 'thematic_index_bottom', 'priority' => 10), 'Single Top' => array('admin_menu_order' => 1000, 'args' => array('name' => 'Single Top', 'id' => 'single-top', 'description' => __('The top widget area displayed on a single post.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_single_top', 'function' => 'thematic_single_top', 'priority' => 10), 'Single Insert' => array('admin_menu_order' => 1100, 'args' => array('name' => 'Single Insert', 'id' => 'single-insert', 'description' => __('The widget area inserted between the post and the comments on a single post.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_single_insert', 'function' => 'thematic_single_insert', 'priority' => 10), 'Single Bottom' => array('admin_menu_order' => 1200, 'args' => array('name' => 'Single Bottom', 'id' => 'single-bottom', 'description' => __('The bottom widget area displayed on a single post.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_single_bottom', 'function' => 'thematic_single_bottom', 'priority' => 10), 'Page Top' => array('admin_menu_order' => 1300, 'args' => array('name' => 'Page Top', 'id' => 'page-top', 'description' => __('The top widget area displayed on a page.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_page_top', 'function' => 'thematic_page_top', 'priority' => 10), 'Page Bottom' => array('admin_menu_order' => 1400, 'args' => array('name' => 'Page Bottom', 'id' => 'page-bottom', 'description' => __('The bottom widget area displayed on a page.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()), 'action_hook' => 'widget_area_page_bottom', 'function' => 'thematic_page_bottom', 'priority' => 10));
    $thematic_widgetized_areas = apply_filters('thematic_widgetized_areas', $thematic_widgetized_areas);
    if (!function_exists('register_sidebars')) {
        return;
    }
    foreach ($thematic_widgetized_areas as $key => $value) {
        register_sidebar($thematic_widgetized_areas[$key]['args']);
        if (!has_action($thematic_widgetized_areas[$key]['action_hook'], $thematic_widgetized_areas[$key]['function'])) {
            add_action($thematic_widgetized_areas[$key]['action_hook'], $thematic_widgetized_areas[$key]['function'], $thematic_widgetized_areas[$key]['priority']);
        }
    }
    // we will check for a Thematic widgets directory and and add and activate additional widgets
    // Thanks to Joern Kretzschmar
    $widgets_dir = @dir(ABSPATH . '/wp-content/themes/' . get_template() . '/widgets');
    if ($widgets_dir) {
        while (($widgetFile = $widgets_dir->read()) !== false) {
            if (!preg_match('|^\\.+$|', $widgetFile) && preg_match('|\\.php$|', $widgetFile)) {
                include ABSPATH . '/wp-content/themes/' . get_template() . '/widgets/' . $widgetFile;
            }
        }
    }
    // we will check for the child themes widgets directory and add and activate additional widgets
    // Thanks to Joern Kretzschmar
    $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;
            }
        }
    }
    // Remove WP default Widgets
    // WP 2.8 function using $widget_class
    if (function_exists('unregister_widget')) {
        unregister_widget('WP_Widget_Meta');
        unregister_widget('WP_Widget_Search');
        unregister_widget('');
        // pre WP 2.8 function using $id
    } else {
        unregister_widget_control('meta');
        unregister_widget_control('search');
    }
    // Finished intializing Widgets plugin, now let's load the thematic default widgets
    register_sidebar_widget(__('Search', 'thematic'), 'widget_thematic_search', null, 'search');
    unregister_widget_control('search');
    register_sidebar_widget(__('Meta', 'thematic'), 'widget_thematic_meta', null, 'meta');
    unregister_widget_control('meta');
    register_sidebar_widget(array(__('RSS Links', 'thematic'), 'widgets'), 'widget_thematic_rsslinks');
    register_widget_control(array(__('RSS Links', 'thematic'), 'widgets'), 'widget_thematic_rsslinks_control', 300, 90);
    // Pre-set Widgets
    $preset_widgets = array('primary-aside' => array('search', 'pages', 'categories', 'archives'), 'secondary-aside' => array('links', 'rss-links', 'meta'));
    if (isset($_GET['activated'])) {
        update_option('sidebars_widgets', apply_filters('thematic_preset_widgets', $preset_widgets));
    }
}
Ejemplo n.º 2
0
function sandbox_widgets_init()
{
    if (!function_exists('register_sidebars')) {
        return;
    }
    // Formats the Sandbox widgets, adding readability-improving whitespace
    $p = array('before_widget' => "\n\t\t\t" . '<li id="%1$s" class="widget %2$s">', 'after_widget' => "\n\t\t\t</li>\n", 'before_title' => "\n\t\t\t\t" . '<h3 class="widgettitle">', 'after_title' => "</h3>\n");
    // Table for how many? Two? This way, please.
    register_sidebars(2, $p);
    // Finished intializing Widgets plugin, now let's load the Sandbox default widgets; first, Sandbox search widget
    $widget_ops = array('classname' => 'widget_search', 'description' => __("A search form for your blog (Sandbox)", "sandbox"));
    wp_register_sidebar_widget('search', __('Search', 'sandbox'), 'widget_sandbox_search', $widget_ops);
    unregister_widget_control('search');
    // We're being Sandbox-specific; remove WP default
    wp_register_widget_control('search', __('Search', 'sandbox'), 'widget_sandbox_search_control');
    // Sandbox Meta widget
    $widget_ops = array('classname' => 'widget_meta', 'description' => __("Log in/out and administration links (Sandbox)", "sandbox"));
    wp_register_sidebar_widget('meta', __('Meta', 'sandbox'), 'widget_sandbox_meta', $widget_ops);
    unregister_widget_control('meta');
    // We're being Sandbox-specific; remove WP default
    wp_register_widget_control('meta', __('Meta', 'sandbox'), 'wp_widget_meta_control');
    //Sandbox RSS Links widget
    $widget_ops = array('classname' => 'widget_rss_links', 'description' => __("RSS links for both posts and comments (Sandbox)", "sandbox"));
    wp_register_sidebar_widget('rss_links', __('RSS Links', 'sandbox'), 'widget_sandbox_rsslinks', $widget_ops);
    wp_register_widget_control('rss_links', __('RSS Links', 'sandbox'), 'widget_sandbox_rsslinks_control');
}
Ejemplo n.º 3
0
function veryplaintxt_widgets_init()
{
    if (!function_exists('register_sidebars')) {
        return;
    }
    $p = array('before_title' => "<h3 class='widgettitle'>", 'after_title' => "</h3>\n");
    register_sidebars(1, $p);
    // Finished intializing Widgets plugin, now let's load the veryplaintxt default widgets; first, veryplaintxt search widget
    $widget_ops = array('classname' => 'widget_search', 'description' => __("A search form for your blog (veryplaintxt)", "veryplaintxt"));
    wp_register_sidebar_widget('search', __('Search', 'veryplaintxt'), 'widget_veryplaintxt_search', $widget_ops);
    unregister_widget_control('search');
    wp_register_widget_control('search', __('Search', 'veryplaintxt'), 'widget_veryplaintxt_search_control');
    // veryplaintxt Meta widget
    $widget_ops = array('classname' => 'widget_meta', 'description' => __("Log in/out and administration links (veryplaintxt)", "veryplaintxt"));
    wp_register_sidebar_widget('meta', __('Meta', 'veryplaintxt'), 'widget_veryplaintxt_meta', $widget_ops);
    unregister_widget_control('meta');
    wp_register_widget_control('meta', __('Meta'), 'wp_widget_meta_control');
    //veryplaintxt Home Link widget
    $widget_ops = array('classname' => 'widget_home_link', 'description' => __("Link to the front page when elsewhere (veryplaintxt)", "veryplaintxt"));
    wp_register_sidebar_widget('home_link', __('Home Link', 'veryplaintxt'), 'widget_veryplaintxt_homelink', $widget_ops);
    wp_register_widget_control('home_link', __('Home Link', 'veryplaintxt'), 'widget_veryplaintxt_homelink_control');
    //veryplaintxt RSS Links widget
    $widget_ops = array('classname' => 'widget_rss_links', 'description' => __("RSS links for both posts and comments (veryplaintxt)", "veryplaintxt"));
    wp_register_sidebar_widget('rss_links', __('RSS Links', 'veryplaintxt'), 'widget_veryplaintxt_rsslinks', $widget_ops);
    wp_register_widget_control('rss_links', __('RSS Links', 'veryplaintxt'), 'widget_veryplaintxt_rsslinks_control');
}
Ejemplo n.º 4
0
function vanilla_widgets_init()
{
    if (!function_exists('register_sidebars')) {
        return;
    }
    $widget_blocks = array('Header Nav', 'Header', 'Main Menu', 'Sub Menu', 'Breadcrumbs', 'Content Top', 'Content Middle', 'Content Bottom', 'Primary Sidebar', 'Secondary Sidebar', 'Utility 1', 'Utility 2', 'Utility 3', 'Utility 4', 'Footer Nav', 'Footer', 'Front Page 1', 'Front Page 2');
    foreach ($widget_blocks as $block) {
        register_sidebar(array('name' => $block, 'id' => sanitize_title_with_dashes(strtolower($block)), 'before_widget' => '<div id="%1$s" class="widget %2$s">' . "\n", 'after_widget' => "</div>\n", 'before_title' => '<h3 class="widgettitle">' . "\n", 'after_title' => "</h3>\n"));
    }
    // Load widgets from the /widgets directory.
    vanilla_load_widgets();
    // Finished intializing Widgets plugin, now let's load the Sandbox default widgets; first, Sandbox search widget
    $widget_ops = array('classname' => 'widget_search', 'description' => __("A search form for your blog (Sandbox)", "sandbox"));
    wp_register_sidebar_widget('search', __('Search', 'sandbox'), 'widget_sandbox_search', $widget_ops);
    unregister_widget_control('search');
    wp_register_widget_control('search', __('Search', 'sandbox'), 'widget_sandbox_search_control');
    // Sandbox Meta widget
    $widget_ops = array('classname' => 'widget_meta', 'description' => __("Log in/out and administration links (Sandbox)", "sandbox"));
    wp_register_sidebar_widget('meta', __('Meta', 'sandbox'), 'widget_sandbox_meta', $widget_ops);
    unregister_widget_control('meta');
    wp_register_widget_control('meta', __('Meta'), 'wp_widget_meta_control');
    // Navigation Top widget
    $widget_ops = array('classname' => 'widget_navigation_top', 'description' => __("Top Prev/Next paging links (Vanilla)", "sandbox"));
    wp_register_sidebar_widget('navigation_top', __('Top Prev/Next', 'sandbox'), 'widget_navigation_top', $widget_ops);
    wp_register_widget_control('navigation_top', __('Top Prev/Next', 'sandbox'), 'widget_navigation_top_control');
    // Navigation Bottom widget
    $widget_ops = array('classname' => 'widget_navigation_bottom', 'description' => __("Bottom Prev/Next paging links (Vanilla)", "sandbox"));
    wp_register_sidebar_widget('navigation_bottom', __('Bottom Prev/Next', 'sandbox'), 'widget_navigation_bottom', $widget_ops);
    wp_register_widget_control('navigation_bottom', __('Bottom Prev/Next', 'sandbox'), 'widget_navigation_bottom_control');
    //Sandbox RSS Links widget
    $widget_ops = array('classname' => 'widget_rss_links', 'description' => __("RSS links for both posts and comments <small>(Sandbox)</small>", "sandbox"));
    wp_register_sidebar_widget('rss_links', __('RSS Links', 'sandbox'), 'widget_sandbox_rsslinks', $widget_ops);
    wp_register_widget_control('rss_links', __('RSS Links', 'sandbox'), 'widget_sandbox_rsslinks_control');
    //Global Nav widget
    $widget_ops = array('classname' => 'widget_globalnav', 'description' => __("Global Navigation Menu <small>(Vanilla)</small>", "sandbox"));
    wp_register_sidebar_widget('globalnav', __('Global Navigation', 'sandbox'), 'widget_globalnav', $widget_ops);
    wp_register_widget_control('globalnav', __('Global Navigation', 'sandbox'), 'widget_globalnav_control');
}
Ejemplo n.º 5
0
function simplr_widgets_init()
{
    if (!function_exists('register_sidebars')) {
        return;
    }
    $p = array('before_title' => "<h3 class='widgettitle'>", 'after_title' => "</h3>\n");
    register_sidebars(2, $p);
    // Finished intializing Widgets plugin, now let's load the Simplr default widgets; first, Simplr search widget
    $widget_ops = array('classname' => 'widget_search', 'description' => __("A search form for your blog (Simplr)", "simplr"));
    wp_register_sidebar_widget('search', __('Search', 'simplr'), 'widget_simplr_search', $widget_ops);
    unregister_widget_control('search');
    wp_register_widget_control('search', __('Search', 'simplr'), 'widget_simplr_search_control');
    // Simplr Meta widget
    $widget_ops = array('classname' => 'widget_meta', 'description' => __("Log in/out and administration links (Simplr)", "simplr"));
    wp_register_sidebar_widget('meta', __('Meta', 'simplr'), 'widget_simplr_meta', $widget_ops);
    unregister_widget_control('meta');
    wp_register_widget_control('meta', __('Meta'), 'wp_widget_meta_control');
    //Simplr Home Link widget
    $widget_ops = array('classname' => 'widget_home_link', 'description' => __("Link to the front page when elsewhere (Simplr)", "simplr"));
    wp_register_sidebar_widget('home_link', __('Home Link', 'simplr'), 'widget_simplr_homelink', $widget_ops);
    wp_register_widget_control('home_link', __('Home Link', 'simplr'), 'widget_simplr_homelink_control');
    //Simplr Recent Comments widget
    $widget_ops = array('classname' => 'widget_simplr_recent_entries', 'description' => __("Semantic recent entries (Simplr)", "simplr"));
    wp_register_sidebar_widget('simplr-recent-entries', __('Recent Entries', 'simplr'), 'widget_simplr_recent_entries', $widget_ops);
    wp_register_widget_control('simplr-recent-entries', __('Recent Entries', 'simplr'), 'widget_simplr_recent_entries_control');
    //Simplr Recent Comments widget
    $widget_ops = array('classname' => 'widget_simplr_recent_comments', 'description' => __("Semantic recent comments (Simplr)", "simplr"));
    wp_register_sidebar_widget('simplr-recent-comments', __('Recent Comments', 'simplr'), 'widget_simplr_recent_comments', $widget_ops);
    wp_register_widget_control('simplr-recent-comments', __('Recent Comments', 'simplr'), 'widget_simplr_recent_comments_control');
    //Simplr RSS Links widget
    $widget_ops = array('classname' => 'widget_rss_links', 'description' => __("RSS links for both posts and comments (Simplr)", "simplr"));
    wp_register_sidebar_widget('rss_links', __('RSS Links', 'simplr'), 'widget_simplr_rsslinks', $widget_ops);
    wp_register_widget_control('rss_links', __('RSS Links', 'simplr'), 'widget_simplr_rsslinks_control');
}
Ejemplo n.º 6
0
            {
                $instance = $old_instance;
                if ($new_instance['title']) {
                    $instance['title'] = strip_tags(stripslashes($new_instance['title']));
                }
                return $instance;
            }
        }
    }
} else {
    if (tla_widget_installed()) {
        if (!function_exists('unregister_sidebar_widget') || !function_exists('unregister_widget_control')) {
            return;
        }
        unregister_sidebar_widget('textlinkads', 'textlinkads_widget');
        unregister_widget_control('textlinkads', 'textlinkads_widget_control');
    }
}
function tla_ads()
{
    global $textlinkads_object;
    $textlinkads_object->outputHtmlAds();
}
function tla_between_content_show($content)
{
    global $wpdb, $textlinkads_object;
    $adlink = '';
    if (!$textlinkads_object) {
        $textlinkads_object = new textlinkadsObject();
        $textlinkads_object->initialize();
    }
Ejemplo n.º 7
0
function sandbox_widgets_init()
{
    if (!function_exists('register_sidebars')) {
        return;
    }
    // Uses H3-level headings with all widgets to match Sandbox style
    $p = array('before_title' => "<h3 class='widgettitle'>", 'after_title' => "</h3>\n");
    // Table for how many? Two? This way, please.
    register_sidebars(2, $p);
    // Finished intializing Widgets plugin, now let's load the Sandbox default widgets
    register_sidebar_widget(__('Search', 'sandbox'), 'widget_sandbox_search', null, 'search');
    unregister_widget_control('search');
    register_sidebar_widget(__('Meta', 'sandbox'), 'widget_sandbox_meta', null, 'meta');
    unregister_widget_control('meta');
    register_sidebar_widget(array(__('RSS Links', 'sandbox'), 'widgets'), 'widget_sandbox_rsslinks');
    register_widget_control(array(__('RSS Links', 'sandbox'), 'widgets'), 'widget_sandbox_rsslinks_control', 300, 90);
}
Ejemplo n.º 8
0
function thematic_widgets_init()
{
    if (!function_exists('register_sidebars')) {
        return;
    }
    // Register Widgetized areas.
    // Area 1
    register_sidebar(array('name' => 'Primary Aside', 'id' => 'primary-aside', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 2
    register_sidebar(array('name' => 'Secondary Aside', 'id' => 'secondary-aside', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 3
    register_sidebar(array('name' => '1st Subsidiary Aside', 'id' => '1st-subsidiary-aside', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 4
    register_sidebar(array('name' => '2nd Subsidiary Aside', 'id' => '2nd-subsidiary-aside', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 5
    register_sidebar(array('name' => '3rd Subsidiary Aside', 'id' => '3rd-subsidiary-aside', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 6
    register_sidebar(array('name' => 'Index Top', 'id' => 'index-top', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 7
    register_sidebar(array('name' => 'Index Insert', 'id' => 'index-insert', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 8
    register_sidebar(array('name' => 'Index Bottom', 'id' => 'index-bottom', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 9
    register_sidebar(array('name' => 'Single Top', 'id' => 'single-top', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 10
    register_sidebar(array('name' => 'Single Insert', 'id' => 'single-insert', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 11
    register_sidebar(array('name' => 'Single Bottom', 'id' => 'single-bottom', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 12
    register_sidebar(array('name' => 'Page Top', 'id' => 'page-top', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // Area 13
    register_sidebar(array('name' => 'Page Bottom', 'id' => 'page-bottom', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "</li>", 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title()));
    // we will check for a Thematic widgets directory and and add and activate additional widgets
    // Thanks to Joern Kretzschmar
    $widgets_dir = @dir(ABSPATH . '/wp-content/themes/' . get_template() . '/widgets');
    if ($widgets_dir) {
        while (($widgetFile = $widgets_dir->read()) !== false) {
            if (!preg_match('|^\\.+$|', $widgetFile) && preg_match('|\\.php$|', $widgetFile)) {
                include ABSPATH . '/wp-content/themes/' . get_template() . '/widgets/' . $widgetFile;
            }
        }
    }
    // we will check for the child themes widgets directory and add and activate additional widgets
    // Thanks to Joern Kretzschmar
    $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;
            }
        }
    }
    // Finished intializing Widgets plugin, now let's load the thematic default widgets
    register_sidebar_widget(__('Search', 'thematic'), 'widget_thematic_search', null, 'search');
    unregister_widget_control('search');
    register_sidebar_widget(__('Meta', 'thematic'), 'widget_thematic_meta', null, 'meta');
    unregister_widget_control('meta');
    register_sidebar_widget(array(__('RSS Links', 'thematic'), 'widgets'), 'widget_thematic_rsslinks');
    register_widget_control(array(__('RSS Links', 'thematic'), 'widgets'), 'widget_thematic_rsslinks_control', 300, 90);
}
Ejemplo n.º 9
0
function webjournal_widgets_init() {
	if ( !function_exists('register_sidebars') )
		return;

	$p = array(
		'before_title' => "<h3 class='widgettitle'>",
		'after_title' => "</h3>\n",
	);

	register_sidebars(2, $p);

	// Finished intializing Widgets plugin, now let's load the webjournal default widgets; first, webjournal search widget
	$widget_ops = array(
		'classname'    =>  'widget_search',
		'description'  =>  __( "A search form for your blog (webjournal)", "webjournal" )
	);
	wp_register_sidebar_widget( 'search', __( 'Search', 'webjournal' ), 'widget_webjournal_search', $widget_ops );
	unregister_widget_control('search');
	wp_register_widget_control( 'search', __( 'Search', 'webjournal' ), 'widget_webjournal_search_control' );

	// webjournal Meta widget
	$widget_ops = array(
		'classname'    =>  'widget_meta',
		'description'  =>  __( "Log in/out and administration links (webjournal)", "webjournal" )
	);
	wp_register_sidebar_widget( 'meta', __( 'Meta', 'webjournal' ), 'widget_webjournal_meta', $widget_ops );
	unregister_widget_control('meta');
	wp_register_widget_control( 'meta', __('Meta'), 'wp_widget_meta_control' );

	//webjournal Home Link widget
	$widget_ops = array(
		'classname'    =>  'widget_home_link',
		'description'  =>  __( "Link to the front page when elsewhere (webjournal)", "webjournal" )
	);
	wp_register_sidebar_widget( 'home_link', __( 'Home Link', 'webjournal' ), 'widget_webjournal_homelink', $widget_ops );
	wp_register_widget_control( 'home_link', __( 'Home Link', 'webjournal' ), 'widget_webjournal_homelink_control' );

	//webjournal Recent Comments widget
	$widget_ops = array(
		'classname'    =>  'widget_webjournal_recent_comments',
		'description'  =>  __( "Semantic recent comments (webjournal)", "webjournal" )
	);
	wp_register_sidebar_widget( 'webjournal-recent-comments', __( 'Recent Comments', 'webjournal' ), 'widget_webjournal_recent_comments', $widget_ops );
	wp_register_widget_control( 'webjournal-recent-comments', __( 'Recent Comments', 'webjournal' ), 'widget_webjournal_recent_comments_control' );

	//webjournal RSS Links widget
	$widget_ops = array(
		'classname'    =>  'widget_rss_links',
		'description'  =>  __( "RSS links for both posts and comments (webjournal)", "webjournal" )
	);
	wp_register_sidebar_widget( 'rss_links', __( 'RSS Links', 'webjournal' ), 'widget_webjournal_rsslinks', $widget_ops );
	wp_register_widget_control( 'rss_links', __( 'RSS Links', 'webjournal' ), 'widget_webjournal_rsslinks_control' );
}
Ejemplo n.º 10
0
    ?>
</em></h2>

	<ul class="posts">
	<?php 
    BX_get_recent_posts($p, $number);
    ?>
	</ul>
<?php 
}
register_sidebars(1, array('before_widget' => "\n", 'after_widget' => "\n", 'before_title' => '<h2><em>', 'after_title' => '</em></h2>'));
wp_register_sidebar_widget('categories', __('Categories'), 'widget_blix_categories');
unregister_widget_control('categories');
wp_register_sidebar_widget('feeds', __('Feeds'), 'widget_blix_feeds');
wp_register_sidebar_widget('recent-posts', __('Recent Posts'), 'widget_blix_recent_posts');
unregister_widget_control('recent-posts');
define('HEADER_TEXTCOLOR', '009193');
define('HEADER_IMAGE', '%s/images/spring_flavour/header_bg.jpg');
// %s is theme dir uri
define('HEADER_IMAGE_WIDTH', 690);
define('HEADER_IMAGE_HEIGHT', 115);
function header_style()
{
    ?>
<style type="text/css">
#header{
	background: url(<?php 
    header_image();
    ?>
) no-repeat;
}