Make WordPress Core

Ticket #4057: themes-widgets.diff

File themes-widgets.diff, 2.2 KB (added by Otto42, 18 years ago)

Adds widget support to the default and classic themes.

  • wp-content/themes/classic/functions.php

     
     1<?php
     2if ( function_exists('register_sidebars') )
     3        register_sidebar(array(
     4        'before_widget' => '<li id="%1$s" class="widget %2$s">',
     5        'after_widget' => '</li>',
     6        'before_title' => '',
     7        'after_title' => '',
     8    ));
     9
     10?>
     11 No newline at end of file
  • wp-content/themes/classic/sidebar.php

     
    33<div id="menu">
    44
    55<ul>
     6<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    67        <?php wp_list_pages('title_li=' . __('Pages:')); ?>
    78        <?php wp_list_bookmarks('title_after=&title_before='); ?>
    89        <?php wp_list_categories('title_li=' . __('Categories:')); ?>
     
    3233                <?php wp_meta(); ?>
    3334        </ul>
    3435 </li>
     36<?php endif; ?>
    3537
    3638</ul>
    3739
  • wp-content/themes/default/functions.php

     
    11<?php
     2if ( function_exists('register_sidebar') )
     3    register_sidebar(array(
     4        'before_widget' => '<li id="%1$s" class="widget %2$s">',
     5        'after_widget' => '</li>',
     6        'before_title' => '<h2 class="widgettitle">',
     7        'after_title' => '</h2>',
     8    ));
    29
    310function kubrick_head() {
    411        $head = "<style type='text/css'>\n<!--";
  • wp-content/themes/default/sidebar.php

     
    11        <div id="sidebar">
    22                <ul>
    3 
     3                        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    44                        <li>
    55                                <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    66                        </li>
     
    6666                                </ul>
    6767                                </li>
    6868                        <?php } ?>
    69 
     69                       
     70                        <?php endif; ?>
    7071                </ul>
    7172        </div>
    7273