Aug 122012
Programming in php: Custom sidebar in single.php on newest questions tagged php – Stack Overflow
I use this code to disply custom single.php pages (by category) in wordpress
and it works fine.
get_header(); ?>
<div id="container">
<div id="content" role="main">
<?php
$post = $wp_query->post;
if (in_category('4')) {
include(TEMPLATEPATH.'/loop-single-recept.php');
} elseif (in_category('7')) {
include(TEMPLATEPATH.'/loop-single.php');
} else {
include(TEMPLATEPATH.'/loop-single.php');
}
?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
But I also want to disply custom sidebars in each single.php page.
See Answers
source: http://stackoverflow.com/questions/11924527/custom-sidebar-in-single-php
Programming in php: programming-in-php
Recent Comments