Make ‘blog’ page show content as well as posts underneath it

Edited answer Thank you for you clarification above, and please give this a try – Note – This code assumes that you are using page.php, a variation of the page templage or some other custom template – it will not work on your index page (index.php). <div id=”page-<?php the_ID(); ?>”> <?php if (have_posts()) : while … Read more

How get top post view for today for today post

As your question does not state, I’m assuming that this is not your main query, but rather a stand alone that tells the visitor the most viewed page of the day. Therefore I believe that an instance of the WP_Query class is what you need. /** Query the posts to find the one with the … Read more

get_posts not pulling the correct number of posts

As stated in comments Most probably your posts per page setting for your site is less than 10 One have to remember, get_posts uses WP_Query. Any new instance of WP_Query and the main query (which also uses WP_Query) uses the value set for Blog pages show at most as default for the posts_per_page parameter when … Read more

Link to date_query results in WordPress

You can use $_GET to get the query string values and then pass it in the $args to create a dynamic WP_Query $after = $_GET[‘after’]; $before = $_GET[‘before’]; and then in the $args if ($after && $before) { $args = array( ‘date_query’ => array( array( ‘after’ => $after, ‘before’ => $before, ‘inclusive’ => true, ), … Read more

Show posts on front page only

The is_home() conditional tag applies to the posts page according to your reading settings or home.php file as opposed to the is_front_page() conditional which applies to the page on front according to your reading settings or your front-page.php file, if it exists. Try changing is_home() to is_front_page() As for another possible problem might be, take … Read more