Use category as a subpage of Pages
-
I would like to be able to use a Category as a sub-page for a Page on my site. Here’s a link to an example of what I’m currently doing:
https://musictech.uncg.edu/trombone/performances/
I’m using a page template to call all of the posts for “Performances”. This is sorta of working, but it breaks the formatting of the right side bar. Here is my template code:
<?php
/*
Template Name: performances.php
*/
?><?php
get_header();
?><div id=”main”>
<div id=”main_inner” class=”fluid”><?php include (TEMPLATEPATH . ‘/leftsidebar.php’); ?>
<div id=”primaryContent_3columns”>
<div id=”columnA_3columns”><br class=”clear”>
<div class=”post”>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class=”post”>
<?php
$myposts = get_posts(‘category=19’);
foreach($myposts as $post) :
?>
<h2 id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h2>
Posted by <?php the_author() ?> on <?php the_time(‘M d Y’);?><?php the_content(); ?>
</div>
<?php endforeach; ?><!– Stop The Loop (but note the “else:” – see next line). –>
<?php endwhile; else: ?><!– The very first “if” tested to see if there were any Posts to –>
<!– display. This “else” part tells what do if there weren’t any. –>
Sorry, no posts matched your criteria.<!– REALLY stop The Loop. –>
<?php endif; ?></div>
</div>
</div><?php include (TEMPLATEPATH . ‘/rightsidebar.php’); ?>
<?php get_footer(); ?>
I found parts of it here and combled it together with the page template of my current theme. It works sorta of and I wondered if either someone can tell me what’s missing to mess up the rightbar format, or if there is an easier way of making a Category appear as a subpage? Thanks!
- The topic ‘Use category as a subpage of Pages’ is closed to new replies.