Results 1 to 3 of 3
-
1st Apr 2012, 01:03 PM #1OPMember
[Help]How to show different sidebar content for different pages?
Hello to everyone I have some questions that I need help to realize them in wordpress. I have a news blog with a different categories/sub-categories.
I use the Avenue Magazine theme, the theme has Homepage sidebar and there have widgets to show posts from a choosen category, but that sidebar displays only to the homepage. What I need is this: The same sidebar but with different content widgets to show in one page (with that I want to get Pages for each parent category and inside that that "homepage sidebar" with widgets for related category)
For example: I have Sports category and for each sport I have sub-categories like: Football,Basketball etc... and Like that for each Parent Category
Same for ex: News and sub categories Country,World etc...
the picture is shown from the blog homepage,you can also access the site from here: http://preview.albpower****
And Finally ,the question is this... How to use that sidebar but with different widgets preferences for each category. Maybe it would be easier if for each category to create different page and like this for each one to have different sidebar content... if YES How to do it??
The actually homepage to stay like it is only for the other to show it like I described upthere.
I asked for help there because I know that there are many experst from this sphere and maybe someone can help me.
Thanks in Advance.
---------- Post added at 06:03 PM ---------- Previous post was at 04:36 PM ----------
Here are the sidebars. I saw from the index.php in editor that there he call the sidebar like dynamic sidebar 'Homepage' something like that the name of the sidebar.
I also taked a look at the sidebar.php
and this is what I found:
PHP Code:<!-- BEGIN SIDEBAR -->
<div id="sidebar">
<?php
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar')):
endif;
?>
</div>
<!-- END SIDEBAR -->
---------- Post added 1st Apr 2012 at 03:03 PM ---------- Previous post was 31st Mar 2012 at 06:03 PM ----------
any help please??albpower Reviewed by albpower on . [Help]How to show different sidebar content for different pages? Hello to everyone I have some questions that I need help to realize them in wordpress. I have a news blog with a different categories/sub-categories. I use the Avenue Magazine theme, the theme has Homepage sidebar and there have widgets to show posts from a choosen category, but that sidebar displays only to the homepage. What I need is this: The same sidebar but with different content widgets to show in one page (with that I want to get Pages for each parent category and inside that that Rating: 5
-
1st Apr 2012, 09:58 PM #2MemberWebsite's:
imdber.org justpaste.meEdit your files:
PHP Code:get_sidebar(); //sidebar.php
PHP Code:get_sidebar('home'); //sidebar-home.php
PHP Code:get_sidebar('foo'); //sidebar-foo.php
Read more
-
2nd Apr 2012, 03:12 PM #3OPMember
hmm I cant get so clear... there is only one sidebar.php with that code in the previosly post. In the index.php
with this code:
PHP Code:<?php get_header(); ?>
<!-- BEGIN MAIN -->
<div id="main">
<?php if(get_option('pyre_featured_slider') == 'On' && get_option('pyre_featured_tags')): ?>
<?php
$post_types = get_post_types();
unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']);
$featured_posts = new WP_Query(array(
'post_type' => $post_types,
'showposts' => 5,
'tag' => get_option('pyre_featured_tags')
));
?>
<!-- BEGIN WRAPPER-FEATURED -->
<div id="wrapper-featured">
<div id="wrapper-slides">
<div id="slider" class="nivoSlider">
<?php while($featured_posts->have_posts()): $featured_posts->the_post(); ?>
<?php if(has_post_thumbnail()): ?>
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured-image'); ?>
<?php $image_thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured-image-thumb'); ?>
<a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" title="#htmlcaption_<?php the_ID(); ?>" rel="<?php echo $image_thumb[0]; ?>" width='516' height='340' /></a>
<?php else: ?>
<a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=516&h=340" alt="<?php the_title(); ?>" title="#htmlcaption_<?php the_ID(); ?>" rel="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=70&h=60" width='516' height='340' /></a>
<?php endif; ?>
<?php endwhile; ?>
</div>
<?php while($featured_posts->have_posts()): $featured_posts->the_post(); ?>
<div class="nivo-html-caption" id="htmlcaption_<?php the_ID(); ?>">
<h1><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h1>
<p><?php echo string_limit_words(get_the_excerpt(), 15); ?> <span class="block-arrows"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>»</a></span></p>
</div>
<?php endwhile; ?>
</div>
</div>
<!-- END WRAPPER-FEATURED -->
<?php endif; ?>
<!-- BEGIN HOMEPAGE BLOCKS -->
<?php if(get_option('pyre_homepage_style') == 'magazine'): ?>
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage')): ?>
<div class="block full">
<h3><?php _e('Recent Posts', 'Avenue'); ?> <span class="arrows">»</span></h3>
<?php
$recent_posts = new WP_Query(array(
'showposts' => 4,
));
?>
<?php
$big_count = round(4 / 4);
if(!$big_count) { $big_count = 1; }
?>
<?php $counter = 1; while($recent_posts->have_posts()): $recent_posts->the_post(); ?>
<?php
if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
$icon = '<span class="' . get_post_format($post->ID) . '-icon"></span>';
} else {
$icon = '';
}
?>
<?php if($counter <= $big_count): ?>
<div class="block-item-big">
<?php if(has_post_thumbnail()): ?>
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'widget-image'); ?>
<div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
<?php else: ?>
<div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=290&h=160" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
<?php endif; ?>
<h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
<span class="block-meta"><?php the_time('F j, Y'); ?>, <?php comments_popup_link(); ?></span>
</div>
<?php else: ?>
<div class="block-item-small">
<?php if(has_post_thumbnail()): ?>
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'widget-image-thumb'); ?>
<div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='50' height='50' /></a><?php echo $icon; ?></div>
<?php else: ?>
<div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=60&h=60" alt="<?php the_title(); ?>" width='50' height='50' /></a><?php echo $icon; ?></div>
<?php endif; ?>
<h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
<span class="block-meta"><?php the_time('F j, Y'); ?>, <?php comments_popup_link(); ?></span>
</div>
<?php endif; ?>
<?php $counter++; endwhile; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if(get_option('pyre_homepage_style') == 'blog'): ?>
<div class="block archive">
<h3>
<?php _e('Recent Posts', 'Avenue'); ?>
<span class="arrows">»</span>
</h3>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('block-item-big'); ?>>
<?php
if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
$icon = '<span class="' . get_post_format($post->ID) . '-icon"></span>';
} else {
$icon = '';
}
?>
<?php if(has_post_thumbnail()): ?>
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'widget-image'); ?>
<div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
<?php else: ?>
<div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=290&h=160" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
<?php endif; ?>
<h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
<span class="block-meta">
<span class="heading-author"><?php the_author(); ?></span>
<span class="heading-date"><?php the_time('F j, Y'); ?></span>
<span class="heading-comments"><?php comments_popup_link('0','1','%'); ?></span>
</span>
<p><?php echo string_limit_words(get_the_excerpt(), 34); ?></p><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>' class="readmore"><?php _e('Read More', 'Avenue'); ?> <span class="block-arrows">»</span></a>
</div>
<?php endwhile; endif; ?>
<?php kriesi_pagination($pages = '', $range = 2); ?>
</div>
<div class='block full' style='padding-top: 20px;'>
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage (Blog Style)')): ?>
<?php endif; ?>
</div>
<?php endif; ?>
<!-- END HOMEPAGE BLOCKS -->
</div>
<!-- END MAIN -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
PHP Code:<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage')): ?>
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
so many show pages
By bydle in forum vBulletinReplies: 2Last Post: 20th Dec 2017, 06:03 PM -
[comments.php] - disable commenting on posts/pages but show comments?
By Darlos in forum WordpressReplies: 1Last Post: 1st Mar 2012, 11:40 AM -
QuickTip: Show More Pages in your WordPress Dashboard
By Faizann20 in forum Tutorials and GuidesReplies: 0Last Post: 2nd Oct 2011, 10:44 AM -
how to show custom code on all pages
By bluedevil in forum vBulletinReplies: 9Last Post: 3rd Sep 2011, 09:13 AM -
Show titles but not content?
By t3od0r in forum IP.BoardReplies: 3Last Post: 24th Jan 2010, 12:26 PM
themaLeecher - leech and manage...
Version 4.94 released. Open older version (or...