Page of posts with certian category
-
So this has been driving me nuts and its the last thing i need to finish my revamp of my site. the URL im working with is:
https://www.mylovemylustmyeverything.com/magazine/issue-01/arts-and-culture
Effectively, i have a series of pages that each contain a set number of posts. what i would like is for each page to only display posts from the category that it corresponds to. for example,i want the page arts and culture to only display posts with the arts and culture category selected.heres the code.
<?php /* Template Name: PageOfPostsArts */ get_header(); ?> <div id="content" class="narrowcolumn"> <h1>Art and Culture:: mlmlme.com</h1> <div id="fadeshow1" style="width: 700px; height: 300px; border: 1px solid black;">slideshow</div> <div id="mainContentTop"> Talk about current cultural movements with hyperlinks to relative articles. talk about underground scenes and the prevailence in media and infiltration into pop culture. talk of street art, graphiti and everything else from vynle toys to vector paintings, have it crammed full of relivant keywords. </div> <?php $showposts = 7; // -1 shows all posts $do_not_show_stickies = 1; // 0 to show stickies $args=array( 'showposts' => $showposts, 'caller_get_posts' => $do_not_show_stickies, ); $my_query = new WP_Query($args); ?> <?php if( $my_query->have_posts() ) : ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <?php //necessary to show the tags global $wp_query; $wp_query->in_the_loop = true; ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_excerpt (); ?> <a href="<?php the_permalink() ?>">Read More..</a> </div> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('? Older Entries') ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries ?') ?></div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php get_search_form(); ?> <?php endif; ?> <a href="">Click Here for Arts and Culture Articles from Past Issues</a> </div> <?php include (TEMPLATEPATH . '/sidebar1.php'); ?> <?php include (TEMPLATEPATH . '/footer.php'); ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Page of posts with certian category’ is closed to new replies.