Make blog page show 10 on first page, 9 on every other page
There was a plugin interfering with the code (Jetpack infinite scroll). Upon disabling it, the first page of the blog correctly displayed 10 posts.
There was a plugin interfering with the code (Jetpack infinite scroll). Upon disabling it, the first page of the blog correctly displayed 10 posts.
Add custom function to child function.php
You can always use posts_clauses filter and add processing for tax_query in there (you don’t even need to write your own SQL): function filter_single_with_tax_queries( $clauses, $query ) { global $wpdb; if ( $query->is_singular ) { $query->parse_tax_query( $query->query_vars ); $tax_clauses = $query->tax_query->get_sql( $wpdb->posts, ‘ID’ ); $clauses[‘join’] .= $tax_clauses[‘join’]; $clauses[‘where’] .= $tax_clauses[‘where’]; } return $parts; } add_action( … Read more
hide custom post types with specific meta key ON admin backend
Why the pagination for a query modified by pre_get_posts doesn’t mind the number & order of posts sorted & selected based on a custom date time field
Tax query in pre_get_posts not working
You can use custom query to show post in your template $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 10 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); the_title(); the_content(); endwhile;
Ah! jQuery to the rescue! function custom_admin_js() { global $get_all_statuses; ?> <script type=”text/javascript”> jQuery(document).ready(function($) { //Bring my $get_all_statuses array and encode it for jquery var myObjects = <?php echo json_encode($get_all_statuses);?>; //Run a each loop : jquery equivalent to php’s foreach $.each(myObjects, function (index, value) { //console.log(index); //Status Label //console.log(index); //Status-name //count the WP list rows … Read more
Blog page pagination is not working after using the offset argument
Category param redirect to post type archive