How to hide Ads in between posts on AMP? [closed]

You should be able to do something like this in your filter function: function prefix_insert_post_ads( $content ) { if ( is_admin() ) { return $content; } if ( ! is_single() ) { return $content; } if ( ! is_amp_endpoint() ) { $ad_code = My Ad code; return prefix_insert_after_paragraph( $ad_code, 4, $content ); } // We … Read more

Get .subsubsub count of post per status queried using pre_get_posts

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