From e8e7c6944162170fef747157ee88cf692b45f78d Mon Sep 17 00:00:00 2001 From: markAking Date: Wed, 6 Jul 2016 12:26:01 -0400 Subject: [PATCH 1/2] fix featured orderby --- .../themes/backer/includes/ignitiondeck-functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php b/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php index 8d828bdc..1a5a25a6 100644 --- a/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php +++ b/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php @@ -292,7 +292,7 @@ function krown_project_grid_shortcode( $atts ) { $args['orderby'] = $orderby; } - $args['order'] = $order; + $args['order'] = 'DESC'; // Define author if present (single) @@ -311,7 +311,6 @@ function krown_project_grid_shortcode( $atts ) { } // Start query and get object - $all_posts = new WP_Query( $args ); ob_start(); -- GitLab From b0665d07efe715cb376a3d6106fd459fc74fb062 Mon Sep 17 00:00:00 2001 From: markAking Date: Wed, 6 Jul 2016 12:38:08 -0400 Subject: [PATCH 2/2] only change status of published project if project is completed --- .../themes/backer/single-ignition_product.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/wordpress/wp-content/themes/backer/single-ignition_product.php b/wordpress/wp-content/themes/backer/single-ignition_product.php index 40b5add0..f19020a5 100644 --- a/wordpress/wp-content/themes/backer/single-ignition_product.php +++ b/wordpress/wp-content/themes/backer/single-ignition_product.php @@ -55,13 +55,15 @@ $percent = get_post_meta( $post->ID, 'ign_percent_raised', true ) != '' ? get_post_meta( $post->ID, 'ign_percent_raised', true ) : 0; $status = $post->post_status; - if($percent == 100){ - wp_update_post( array( 'ID'=>$post->ID, 'post_status' => 'completed' ) ); - $status = 'completed'; - } - if($percent != 100 && $ign_days_left == 0){ - wp_update_post( array( 'ID'=>$post->ID, 'post_status' => 'closed' ) ); - $status = 'closed'; + if($status == 'publish'){ + if($percent == 100){ + wp_update_post( array( 'ID'=>$post->ID, 'post_status' => 'completed' ) ); + $status = 'completed'; + } + if($percent != 100 && $ign_days_left == 0){ + wp_update_post( array( 'ID'=>$post->ID, 'post_status' => 'closed' ) ); + $status = 'closed'; + } } ?> -- GitLab