From 5d7043d6f0ef85e742fca1f60f18f241298599f0 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 10 May 2018 12:49:32 -0400 Subject: [PATCH] fixing the category selection for parallax types --- inc/accesspress-options.php | 8 +++++--- layouts/portfolio-section.php | 1 - layouts/service-section.php | 16 +++++++++++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/inc/accesspress-options.php b/inc/accesspress-options.php index 9f374c7..121a3b9 100644 --- a/inc/accesspress-options.php +++ b/inc/accesspress-options.php @@ -54,13 +54,15 @@ function optionsframework_options() { // Parallax Defaults $parallax_defaults = NULL; - + $taxonomy = 'parallax_posts_category'; + $terms = get_terms($taxonomy); + // print_r($terms); // Pull all the categories into an array $options_categories = array(); - $options_categories_obj = get_categories(); + $options_categories_obj = $terms; $options_categories[''] = 'Select a Category:'; foreach ($options_categories_obj as $category) { - $options_categories[$category->cat_ID] = $category->cat_name; + $options_categories[$category->term_id] = $category->name; } // Pull all tags into an array diff --git a/layouts/portfolio-section.php b/layouts/portfolio-section.php index 5057139..8568656 100644 --- a/layouts/portfolio-section.php +++ b/layouts/portfolio-section.php @@ -15,7 +15,6 @@ ); $query = new WP_Query($args); - print_r($query); if($query->have_posts()): $i = 0; while($query->have_posts()): $query->the_post(); diff --git a/layouts/service-section.php b/layouts/service-section.php index 7ae1c91..1921b58 100644 --- a/layouts/service-section.php +++ b/layouts/service-section.php @@ -4,17 +4,23 @@ * * @package accesspress_parallax */ -?> +?>
- 'glm-parallax', - 'cat' => 'parallax', - 'posts_per_page' => -1 + 'posts_per_page' => -1, + 'tax_query' => array( + array( + 'taxonomy' => 'parallax_posts_category', + 'field' => 'term_id', + 'terms' => $category + ) + ) ); $count_service = 0; - $query = new WP_Query($args); + $query = new WP_Query($args); if($query->have_posts()): $i = 0; while ($query->have_posts()): $query->the_post(); -- 2.17.1