How only display all post related to category

I’m trying to make a custom template for my category pages that only pulls in post under a specific category. At the moment, I am only able to pull in all post and not category specific… My code so far…. <?php //Identify current Post-Category-ID foreach((get_the_category()) as $category) { $postcat= $category->cat_ID; $catname =$category->cat_name; } ?> //Print … Read more

How to display posts by current user/author in a custom page template?

I am a trying to create a dashboard like custom page template that list post of of the current logged in user. I’ve tried to find a solution on the net. but none were appropriate 2 Answers 2 this should work for you: if ( is_user_logged_in() ): global $current_user; wp_get_current_user(); $author_query = array(‘posts_per_page’ => ‘-1′,’author’ … Read more