Hey Ihr :) ,
Wie bekomm ich es hin, dass meine Sidebar nach diesem Muster aussieht:
PHP
<div id="sidebar">
<div id="recent_articles"/>
<ul>
<div id="recent_comments"/>
<ul>
<div id="categories">
<ul>
Das ist die grobe Ansicht aus Firebug!
Ich will auf die h2,h3 Titel verzichten und für jede div id Hintergrundbilder einsetzen. Letzteres ist kein Problem. Ich bin aber ratlos, was ich in der functions.php verändern muss, damit es so aussieht wie oben!
PHP
<?php
// helper functions
if ( function_exists('wp_list_bookmarks') ) //used to check WP 2.1 or not
$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' and post_status = 'publish'");
else
$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'");
if (0 < $numposts) $numposts = number_format($numposts);
$numcmnts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
if (0 < $numcmnts) $numcmnts = number_format($numcmnts);
// ----------------
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '<li class="sidebox">',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
if ( function_exists('unregister_sidebar_widget') )
{
unregister_sidebar_widget( __('Links') );
}
if ( function_exists('register_sidebar_widget') )
{
register_sidebar_widget(__('Links'), 'mistylook_ShowLinks');
}
if ( function_exists('register_sidebar_widget') )
{
register_sidebar_widget(__('About'), 'mistylook_ShowAbout');
}
function mistylook_ShowAbout() {?>
<li class="sidebox">
<h3><?php _e('About','ml');?></h3>
<p>
<img src="<?php bloginfo('stylesheet_directory');?>/img/profile.jpg" alt="<?php _e('Profile','ml');?>" /><br/>
<strong><?php bloginfo('name');?></strong><br/><?php bloginfo('description');?><br/>
<?php _e('There are','ml');?> <?php global $numposts;echo $numposts; ?> <?php _e('Posts and','ml');?> <?php global $numcmnts;echo $numcmnts;?> <?php _e('Comments so far.','ml');?>
</p>
</li>
<?php }
function mistylook_ShowRecentPosts() {?>
<li class="sidebox">
<h3><?php _e('Recent Posts','ml');?></h3>
<ul><?php wp_get_archives('type=postbypost&limit=6');?></ul>
</li>
<?php }
Alles anzeigen
Vermutlich muss hier was getan werden:
PHP
'before_widget' => '<li class="sidebox">',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>',
Bin für jede Hilfe dankbar! :oops: LG DieJulia