Hallöchen,
ich habe mich nun nach 3 Stunden doch entschlossen hier mal ein paar Profis zu fragen :mrgreen: .
Ich benutze ein Theme (iPhonFan) welches ich wigdetfähig machen möchte. Ich habe mich schon durchgegoogelt und weiß das ich:
1. eine functions.php brauche
oder
PHP
<?php
if ( function_exists('register_sidebar') )
{
register_sidebar( array(
'before_widget' => '<div id="..." class="...">',
'after_widget' => '</div>',
'before_title' => '<div class="...">',
'after_title' => '</div>' ) );
}
?>
Alles anzeigen
und
2. diesen Verweis in der sidebar.php
bzw.
PHP
<ul id="sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<?php endif; ?>
</ul>
Meine sidebar.php sieht so aus:
PHP
<!-- WP Termina Loop | Inicia Sidebar -->
</div> <!-- DIV de cierre 'iPhoneContainer' -->
</div> <!-- DIV de cierre 'IPhoneScreen' -->
<div id="iPhoneFooter"> <!-- Parte Inferior del iPhone -->
<div class="home"><a href="<?php echo get_option('home'); ?>/"><img src="<?php bloginfo('stylesheet_directory'); ?>/pix/blank.gif" width="50" height="50" border="0" /></a></div>
</div>
</div> <!-- DIV de cierre 'IPhoneBox' -->
<!-- Termina iPhone Body | Inicia Barra Lateral -->
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div id="Bar">
<div id="BarHeader"></div>
<div id="BarContainer">
<img src="<?php bloginfo('stylesheet_directory'); ?>/pix/blank.gif" width="220" height="1" border="0" /> <!-- Patch -->
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<!-- Standard-Sidebar, wenn keine Widgets vorhanden sind -->
<div id="BarBox">
<!-- Search -->
<h2><?php _e('Search'); ?></h2>
<div id="search">
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
</div>
<!-- "Search Data" -->
<?php if ( is_404() || is_category() || is_day() || is_month() ||
is_year() || is_search() || is_paged() ) {
?>
<?php /* If this is a 404 page */ if (is_404()) { ?>
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
<p class="data_b">You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>
<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
<p class="data_t">You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for the day <?php the_time('l, F jS, Y'); ?>.</p>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<p class="data_t">You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for <?php the_time('F, Y'); ?>.</p>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<p class="data_t">You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for the year <?php the_time('Y'); ?>.</p>
<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
<p class="data_s">You have searched the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p class="data_b">You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives.</p>
<?php } ?>
<?php } ?>
<hr/>
<!-- "RSS Links" -->
<div id="RSS"><a href="<?php bloginfo('rss2_url'); ?>"><?php _e('Syndicate this site using RSS'); ?></a><br /></div>
<hr />
<!-- "Pages" -->
<h2><?php _e('Pages'); ?></h2>
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>
<hr />
<!-- "Categories" -->
<h2><?php _e('Categories'); ?></h2>
<ul>
<?php wp_list_categories('show_count=1&title_li='); ?>
</ul>
<hr />
<!-- "Archives" -->
<h2><?php _e('Archives'); ?></h2>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
<!-- "Blogroll" -->
<?php /* Links */ if ( (is_home()) and !(is_page()) and !(is_single()) and !(is_search()) and !(is_archive()) and !(is_author()) and !(is_category()) and !(is_paged()) ) { $links_list_exist = @$wpdb->get_var("SELECT link_id FROM $wpdb->links LIMIT 1"); if($links_list_exist) { ?>
<hr />
<div id="blogroll">
<?php wp_list_bookmarks(); ?>
</div>
<?php } ?>
<?php } ?>
<!-- "Theme Credit" -->
<hr />
<div id="Karma">
<div id="kb"><a href="http://www.iphonefan.com/blog"><img src="<?php bloginfo('stylesheet_directory'); ?>/pix/Sticker_iPF.png" width="60" height="60" border="0" /></a></div>
<a href="http://iphonefan.com/wordpress_theme/"><span class="kt">iPhoneFan</span><br/>Wordpress Theme</a><br /><br />
Designed by <a href="http://bacteriano.com">Bacteriano</a> <!--based on iPhone PSD file designed by <a href="http://manicho.deviantart.com">Manicho</a>-->.
</div>
<img src="<?php bloginfo('stylesheet_directory'); ?>/pix/blank.gif" width="220" height="1" border="0" /> <!-- Patch -->
</div> <!-- DIV de cierre 'BarBox' -->
<img src="<?php bloginfo('stylesheet_directory'); ?>/iPF_pix/ipf_null.gif" width="220" height="1" border="0" /> <!-- Patch para Firefox -->
</div> <!-- DIV de cierre 'BarContainer' -->
<div id="BarFooter"></div>
<!-- "WP Credit" -->
<div id="WP" align="center">
<a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform."><img src="<?php bloginfo('stylesheet_directory'); ?>/pix/Sticker_WP.png" border="0" /></a>
<?php wp_meta(); ?>
</div>
</div> <!-- DIV de cierre 'Bar' -->
<?php endif; ?>
Alles anzeigen
Meine functions.php so:
PHP
<?php
if ( function_exists('register_sidebar') )
{
register_sidebar( array(
'before_widget' => '<div id="" class="">',
'after_widget' => '</div>',
'before_title' => '<div class="">',
'after_title' => '</div>' ) );
}
?>
Alles anzeigen
Und meine style.css Auszugsweise...
PHP
/* @group Sidebar */
#Bar {
float: right;
width: 240px;
}
#BarHeader {
width: 240px;
height: 20px;
background-image: url(pix/ipf_sb_head.png);
behavior: url(iepngfix.htc);
margin-top: 17px;
}
#BarContainer {
width: 240px;
height: auto;
background: url(pix/ipft_sb_body.png) repeat-y;
behavior: url(iepngfix.htc);
}
#BarBox {
font-size: 13px;
margin-left: 20px;
width: 200px;
}
/* @group Busqueda */
#search {
margin-top: 15px;
}
.busqueda {
text-align: center;
}
#bsqd {width: 150px;}
#bsqd, #submit {vertical-align: bottom;
}
#bsqd, input[type="text"], input[type="password"], textarea { background: #ccc;
border: 2px solid; border-color: #000 #D9D9D9 #D9D9D9 #000;}
.data_s {
width: 160px;
background: url(pix/spot.png) no-repeat;
padding-left: 30px;
font-size: 10px;
margin-left: 10px;
padding-bottom: 3px;
}
.data_b {
width: 160px;
background: url(pix/safari.png) no-repeat;
padding-left: 30px;
font-size: 10px;
margin-left: 10px;
padding-bottom: 3px;
}
.data_t {
width: 160px;
background: url(pix/calendar.png) no-repeat;
padding-left: 30px;
font-size: 10px;
margin-left: 10px;
padding-bottom: 3px;
}
/* @end */
#RSS {
height: 24px;
width: 160px;
padding-left: 30px;
line-height: 12px;
background: url(pix/feed-icon-24x24.png) no-repeat;
margin-bottom: 10px;
margin-left: 10px;
margin-top: 15px;
}
#BarBox h2 {
color: #69c;
font-size: 16px;
text-align: left;
margin-top: 0;
margin-bottom: -12px;
}
#BarBox ul {
list-style-type: none;
list-style-image: none;
margin-bottom: 15px;
}
#BarBox li {
list-style-type: none;
list-style-image: none;
text-indent: -5px;
margin-left: -25px;
margin-bottom: 1px;
margin-top: 0;
}
#BarBox a {
color: #fff;
}
#BarBox a:hover {
color: #fbcc18;
}
.morelasts {
padding-top: 2px;
padding-bottom: 2px;
}
#blogroll {
padding-left: 30px;
}
#creditos {
margin-top: 20px;
}
#BarFooter {
width: 240px;
height: 25px;
background-image: url(pix/ipf_sb_bottom.png);
behavior: url(iepngfix.htc);
}
#Karma {
margin-top: 10px;
width: 130px;
padding-left: 70px;
font-size: 10px;
background-repeat: no-repeat;
}
.kt {
font-size: 12px;
}
#kb {
width: 60px;
height: 60px;
float: left;
margin-left: -70px;
}
#WP {
margin-top: 60px;
width: 200px;
margin-left: auto;
margin-right: auto;
}
/* @end */
Alles anzeigen
Vorab ich bin kein Profi und mache sowas nicht täglich...
Geändert habe ich zum Bsp. schon in der functions.php:
PHP
'before_widget' => '<div id="BarHeader bzw. BarContainer" class="BarHeader bzw. BarContainer">',
'after_widget' => '</div>',
'before_title' => '<div class="BarBox h2 oder BarHeader">',
'after_title' => '</div>' ) );
[COLOR=Black]
Und habe dann gegenteilig in der sidebar.php den Code in den Zeilen verschoben:
[/COLOR]
Nunja, nicht immer nach Plan... :-?
Momentan sieht es so aus wie im Anhang meines Posts.