November 06, 2014
global $post; $name = get_post( $post )->post_name; $args = array( 'post_type' => 'post', 'orderby' => 'date', 'order' => 'DESC', 'category_name' => $name ); $post_feed = get_posts($args);
This handy bit of code will allow you to pull posts into multiple template pages, using multiple categories (child categories feeding into the parent categories) and display them only on the relevant page of the same name as the Category. You can create as many categories as you want, and they will only feed onto the template pages of the same name. Can I get an amen?