After adding my website to a new server, I keep getting a unexpected end of file error, but the file is identitcal to it’s original source

So the issue has already been resolved via the comments and the current state of the question already includes the corrected code. But I thought I should post this answer as a reminder for you, me and everyone reading this. 🙂 So first off, here’s a helpful excerpt from an article on WP Engine: The … Read more

WP check_ajax_referer() is not working

One is When I use the shortcode of the form in the page or post, showing the form in the WP backend 5.2.3 version. That happens because your shortcode is echoing the output. A shortcode should always return the output, but if you need to echo it, then you should use output buffering: public function … Read more

woocommerce specific quantities for product

Try this in your functions.php: add_filter( ‘woocommerce_quantity_input_args’, ‘control_product_qty_input’, 20, 2 ); function control_product_qty_input( $args, $product ) { $settings = array(’49’ => 3, ’48’ => 10); // for product id 49 3 products set foreach ($settings as $k => $v) { if($k === $product->get_id()){ $args[‘max_value’] = $v; $args[‘min_value’] = $v; } } return $args; } Note: … Read more

Remove page title in product page using a function

There are two ways of doing this – with hooks, or by overriding the WooCommerce template file in your Child theme. First, let’s look at the file override: Method 1 – File Override From the WooCommerce plugin folder, copy the templates/single-product/title.php file, and paste it into your active theme under woocommerce/single-product/title.php Then, simply change this … Read more

Target post_date_gmt if it’s empty or not set

I’ve figured it out: ‘meta_query’ => array( array( ‘relation’ => ‘OR’, array( ‘key’ => ‘_setting_update’, ‘value’ => ‘1’, ‘compare’ => ‘==’ ), array( ‘relation’ => ‘AND’, array( ‘key’ => ‘_created_date’, ‘value’ => ”, ‘compare’ => ‘NOT EXISTS’, ), array( ‘key’ => ‘_modified_date’, ‘value’ => ”, ‘compare’ => ‘NOT EXISTS’, ), ) ), ),

Increment paged on WP_Query

You need to create a new WP_Query instance with the updated arguments. I will usually write it like this $args = [ ‘post_type’ => ’employee’, ‘post_status’ => ‘any’, ‘posts_per_page’ => 10, ‘paged’ => 1, ]; $query = new WP_Query($args); while ($query->have_posts()) { // your logic goes here // foreach ($query->posts as $custom_stuff) {} // prepare … Read more