Display a singular category on a page, an oldie but a goodie!
-
Hi All,
Sorry for bring up this old one again, but i am having hair pulling out problems with this!
I am converting a Theme for a friend, and have gone through and tried changing the PHP for the main styled page using
<?php $catID = 0; if (is_page('18')) { $catID=3; } elseif (is_page('27')) { $catID=4; } if ($catID) { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=$catID&paged=$paged"); } ?>
But its not having any of it!
Here is the code for the whole page that I have created for it:
<?php /* Template Name: Challenge Page */ ?> <?php get_header(); ?> <div id="featured"> <div id="page-title" class="content"> <h2 class="page"><?php the_title(); ?></h2> </div> </div> <!-- Content Starts --> <div id="main-content" class="page"> <div class="content"> <div class="col-left"> <div id="main"> <div class="post"> <h2><?php _e('Challenge Posts',woothemes); ?></h2> <ul> <?php $catID = 0; if (is_page('18')) { $catID=3; } elseif (is_page('27')) { $catID=4; } if ($catID) { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=$catID&paged=$paged"); } ?> </div><!-- main ends --> </div><!-- .col-left ends --> <?php get_sidebar(); ?> </div> </div><!-- Content Ends --> <?php get_footer(); ?>
You can view the page that I am working on here: https://www.theundentabletrust.co.uk/new/?page_id=18
All help is appreciated, I’m already going bald, i don’t need the extra help!
Thanks
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Display a singular category on a page, an oldie but a goodie!’ is closed to new replies.