hallo zusammen
nach langem suchen und ausprobieren muss ich mich jetzt an euch wenden. Leider komm ich dem Fehler nicht auf die Schliche.
Ich habe eine Webseite wo ich eine Kategorie News (Post), 5 normale statische Seiten und noch eine Kategorie Get Infected mit unter Kategorien.
Ich möchte nun das bei der Kat. News und den Statischenseiten eine verkleinerte Sidebar rechts angezeigt wird. Diese beinhaltet nur die Suche & einen Newsletter.
Bei der Kategorie Get Infected und deren Unterkategorien sollen noch zusätzliche Sachen angezeigt werden.
Mit der Hilfe die ich hier gefunden habe konnte ich dies so weit erstellen, leider zeigts mir aber nur die verkleinerte Sidebar in der News Kat. an. Alle statischen Seiten haben auch die grössere Sidebar. Hoffe ihr versteht was ich meine.
Hier noch die Codes der Sidebars
stereobar.php
<div id="navi">
<div id="navi-innen">
<?php
// if in category and there are subcategories
if (is_page('media')) { ?>
<ul>
<?php /*wp_list_cats('title_li=&sort_column=name&exclude=3');*/
is_category('Videos&title_li=');?>
<?php
$variable = wp_list_categories('echo=0&title_li=<h2>Pages</h2>&include=9');
$variable = str_replace(array('(',')'), '', $variable);
echo $variable;
?>
</ul>
<?php } ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<h2><?php _e('Pages'); ?></h2>
<ul>
<li><a href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_pages('sort_column=menu_order&title_li='); ?>
</ul>
<h2><?php _e('Categories'); ?></h2>
<ul>
<?php if (function_exists('wp_list_cats')) {
wp_list_cats('sort_column=name&optioncount=1');
}
else {
wp_list_categories('sort_column=name&show_count=1&title_li');
} ?>
</ul>
<h2><?php _e('Archives'); ?></h2>
<ul>
<?php wp_get_archives('type=monthly&show_post_count=1'); ?>
</ul>
<h2><label for="s"><?php _e('Search:'); ?></label></h2>
<form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
<div>
<input type="text" name="s" id="s" size="17" class="navi-search" /><br />
<input type="submit" name="submit" value="<?php _e('Search'); ?>" class="search-button" />
</div>
</form>
<h2>RSS-Feeds</h2>
<ul>
<li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
</ul>
<h2>Blogroll</h2>
<ul>
<?php wp_list_bookmarks('categorize=0&title_li=0'); ?>
</ul>
<?php endif; ?>
<?php if (function_exists('wp_theme_switcher')) { ?>
<h2>Styleswitcher</h2>
<?php wp_theme_switcher(); ?>
<?php } ?>
<?php /* if (is_category(1) && in_category(1)) : */ ?>
<?php if (is_category(1)) : ?>
<ul>
<?php /* is_category('get-infected&title_li='); */?>
<?php
$variable1 = wp_list_categories('echo=0&title_li=<h2>Pages</h2>&exclude=3&child_of=1');
$variable1 = str_replace(array('(',')'), '', $variable1);
echo $variable1;
?>
</ul>
<!-- mail into the studio -->
<h2>mail into the studio</h2>
<ul>
<a href="http://www.stereoriders.com/web/contact">click here</a>
</ul>
<?php /*}*/ ?>
<?php endif; ?>
</div>
</div>
<hr />
Alles anzeigen
sidebar.php
<?php
if (in_category(1)) {
include (TEMPLATEPATH . '/infectedbar.php');
} else {
include (TEMPLATEPATH . '/stereobar.php');
}
?>
infectedbar.php
<div id="navi">
<div id="navi-innen">
<?php
// if in category and there are subcategories
if (is_category('get-infected') || in_category('get-infected')) { ?>
<ul>
<?php /* is_category('get-infected&title_li='); */?>
<?php
$variable = wp_list_categories('echo=0&title_li=<h2>Pages</h2>&exclude=3&child_of=1');
$variable = str_replace(array('(',')'), '', $variable);
echo $variable;
?>
</ul>
<?php } ?>
<!-- mail into the studio -->
<h2>mail into the studio</h2>
<ul>
<a href="http://www.stereoriders.com/web/contact">click here</a>
</ul>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<h2><?php _e('Pages'); ?></h2>
<ul>
<li><a href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_pages('sort_column=menu_order&title_li='); ?>
</ul>
<h2><label for="s"><?php _e('Search:'); ?></label></h2>
<form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
<div>
<input type="text" name="s" id="s" size="17" class="navi-search" /><br />
<input type="submit" name="submit" value="<?php _e('Search'); ?>" class="search-button" />
</div>
</form>
<h2>RSS-Feeds</h2>
<ul>
<li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
</ul>
<h2>Blogroll</h2>
<ul>
<?php wp_list_bookmarks('categorize=0&title_li=0'); ?>
</ul>
<?php endif; ?>
<?php if (function_exists('wp_theme_switcher')) { ?>
<h2>Styleswitcher</h2>
<?php wp_theme_switcher(); ?>
<?php } ?>
<?php the_podcast(); ?>
<?php the_stream(); ?>
</div>
</div>
<hr />
Alles anzeigen
Danke schon mal für eure Hilfe!
Rogero