Markus "guruz" Goetz

[ index | hardware | projects and coding | p300 | blog | contact ]




Oktober 4, 2007 at 6:44 pm.
Abgelegt unter: Coding,Meta
guruz @ 6:44 pm

WordPress: Zwei Sidebars in Theme einbauen

In functions.php:

if ( function_exists('register_sidebar')) {
        register_sidebar(array(
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget' => '</div>',
        'before_title' => '',
        'after_title' => '',
        'name' => 'Left'
    ));
        register_sidebar(array(
         'before_widget' => '<div id="%1$s" class="widget %2$s">',
         'after_widget' => '</div>',
         'before_title' => '',
         'after_title' => '',
         'name' => 'Right'
   ));
}

Datei right_sidebar.php:

<!-- begin sidebar -->
<div id="RightSidebar">
<?php if ( !function_exists('dynamic_sidebar')
        || !dynamic_sidebar('Right') ) : ?>
        This theme needs dynamic sidebars
<?php endif; ?>
</div>
<!-- end sidebar -->

Datei left_sidebar.php:

<!-- begin sidebar -->
<div id="LeftSidebar">
<?php if ( !function_exists('dynamic_sidebar')
        || !dynamic_sidebar('Left') ) : ?>
        This theme needs dynamic sidebars
<?php endif; ?>
</div>
<!-- end sidebar -->

Einbauen in z.B. header.php oder footer.php mit:

<? include (TEMPLATEPATH . '/right_sidebar.php'); ?>
Willst du automatisch ueber neue Artikel informiert werden? Dann subscribe dich via E-Mail oder via RSS


Moronic Glossyblue WordPress theme by N.Design Studio
WordPress: RSS Feed for Categories
Yay.. neue Blogsoftware

Comment Feed

Keine Kommentare

Leider ist die Kommentarfunktion zur Zeit deaktiviert.