Rewind posts then show only first post

There if few ways to achieve what you need: Option 1: Add break after the_content() in the main content loop. Option 2: You can do something like this but I don’t think so that it is a good solution. <?php if (have_posts()) : $first_post = true; ?> <div class=”sidebar”> <ul> <?php while (have_posts()) : the_post(); … Read more

View related categories in order of posts

You are looping through the posts by category and only inside your loop you get the published date. By that time you cannot change the order anymore, unless you postpone echoing the posts to a second loop, where you order them by date. So, inside your foreach loop you do this: $post_array[$news_query->ID] = $news_query->post_date; This … Read more

Category Archive not working for pages

Your code did work for me; I was able to see pages under the category archive for Association Landing Pages at http://domain.com/category/association-landing-pages. It sounds like you need to use the URL: localhost/mywordpressitefolder/category/association-landing-pages I noticed that you said that the slug was association-landing-pages and then you visited localhost/mywordpressitefolder/association-landing-page (without the s). Make sure to use the … Read more

WP_Query don’t working with fixed post_id and term_taxonomy

The behavior you described is how WordPress works by design, if you provide a ‘p’ parameter, then ‘tax_query’ is ignored, see inside this else statment in wp-includes/query.php:L1643, this is where ‘tax_query’ is processed and added to the SQL statement, and this only happens if this if (line 1634) is skipped.