Filter posts by categories ajax is showing all the posts

In your code, I have found 2 issues: 1) In your ajax function ajax_filter_get_posts(), you have missed tax_query in your arg. Your ajax function ajax_filter_get_posts() should be as below: function ajax_filter_get_posts( $taxonomy ) { // Verify nonce if( !isset( $_POST[‘afp_nonce’] ) || !wp_verify_nonce( $_POST[‘afp_nonce’], ‘afp_nonce’ ) ) die(‘Permission denied’); $taxonomy = $_POST[‘taxonomy’]; // WP Query … Read more

How to remove the post pagination (Next page tag) depending on type of traffic source: from utm_campain or non-utm_campain

So, I found the decision: add_action( ‘the_post’, ‘campaign_remove_nextpage’, 99); function campaign_remove_nextpage ( $post ) { if (($_GET[‘utm_campaign’]== ‘Facebook’ || $_GET[‘utm_campaign’]== ‘Twitter’) && (false !== strpos( $post->post_content, ‘<!–nextpage–>’ )) ) { } else { $totalArticlesPages = substr_count($post->post_content, ‘<!–nextpage–>’); // Google: not paginated // Direct: not paginated // Camp: paginated // Reset the global $pages: $GLOBALS[‘pages’] = … Read more