Checking array against author id in loop

You actually want author__in, and you can use the array. You shouldn’t implode it: $query = new WP_Query( array( ‘author__in’ => $friendsIdArray ) ); As far as where in the Loop this goes, I’m not sure I understand. This occurs before creating your a Loop, not in it.

how to make custom ajax handler?

You have to include WP core function files, something like this… <?php //mimic the actuall admin-ajax define(‘DOING_AJAX’, true); if (!isset( $_POST[‘action’])) die(‘-1’); //make sure you update this line //to the relative location of the wp-load.php require_once(‘../../../../../wp-load.php’); //Typical headers header(‘Content-Type: text/html’); send_nosniff_header(); //Disable caching header(‘Cache-Control: no-cache’); header(‘Pragma: no-cache’); You can read more about this here https://coderwall.com/p/of7y2q/faster-ajax-for-wordpress … Read more

My new button is in the wrong place

I figured it out, it was a pretty simple oversight actually. I forgot the the number after the add or remove action represents priority and by putting the same priority I was messing things up. So i just removed the priority to the remove add to cart action. So my code now looks like this … Read more

Commenting out unwated CSS/scripts in HTML with PHP

Install Query Monitor to show your scripts and styles (#qm-assets) – specifically the ID used to register the scripts/styles. Then hook wp_print_scripts and use wp_dequeue_script() to remove it before it outputs. /** * Dequeue the jQuery UI script. * * Hooked to the wp_print_scripts action, with a late priority (100), * so that it is … Read more