Home Forums Responsive Themes Coupon Theme Sort by featured Reply To: Sort by featured

  • JamesD
    April 4, 2019 at 1:13 am

    Was wondering if you had the class childtheme_coupon_core class in your _functions.php or any other class in there? If so, then it may be better to put the above function within the class itself and call the ‘add_action’ from within the ‘__construct’ section.

    Here’s some code you can add (in conjunction with the above code) if you wanted to change the expiration meta query:

    	        $curr_meta_query = array( 'expirydate' => array(
    	            'key' => 'expiry_date',
    	            'value' => date('Y-m-d H:i:s',  time()),
    	            'compare' => '<=',
    	            'type' => 'DATETIME'
    	        $wp_obj->set( 'meta_query', $curr_meta_query);

    This example would look for all the coupons that have expired prior to that moment.
    Note: The setting PremiumPress > Configuration > Coupon Settings > SHOW EXPIRED COUPONS would need to be turned on.

  • Copyright © 2010-2020 PremiumPress Limited.

    secure payments