From 9792cafd0d0a2ab2d70a5b99a1feea3f6974548b Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 10 May 2018 14:34:04 -0400 Subject: [PATCH] fixing the categories for the front page parallax sections --- inc/accesspress-options.php | 2 +- inc/ajax.php | 2 +- index-parallax.php | 31 +++++++++++++++++++++++-------- layouts/service-section.php | 2 +- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/inc/accesspress-options.php b/inc/accesspress-options.php index d21a172..686dfd7 100644 --- a/inc/accesspress-options.php +++ b/inc/accesspress-options.php @@ -71,7 +71,7 @@ function optionsframework_options() { foreach ( $options_tags_obj as $tag ) { $options_tags[$tag->term_id] = $tag->name; } - + $args = array( 'post_type' => 'glm-panel', 'posts_per_page' => -1 diff --git a/inc/ajax.php b/inc/ajax.php index b95f337..0525fa6 100644 --- a/inc/ajax.php +++ b/inc/ajax.php @@ -11,11 +11,11 @@ $countsettings = esc_attr( $_REQUEST['count_section'] ); $args = array( 'post_type' => 'glm-panel', - 'cat' => 'panel', 'posts_per_page' => -1 ); $count_service = 0; $panels= new WP_Query($args); + $panels = $panels->posts; ?>
diff --git a/index-parallax.php b/index-parallax.php index 2d0116f..a4d6648 100644 --- a/index-parallax.php +++ b/index-parallax.php @@ -16,15 +16,22 @@ ID , 'panel_category' ); + foreach($terms as $term){ + $categories[] = $term->term_id; + } ?> - +
" id="ID); ?>"> @@ -34,11 +41,19 @@
- 'glm-panel', - 'posts_per_page' => -1 - ); + 'posts_per_page' => -1, + 'tax_query' => array( + array( + 'taxonomy' => 'panel_category', + 'field' => 'term_id', + 'terms' => $categories + ) + ) + ); $count_service = 0; $query = new WP_Query($args); while ( $query->have_posts() ) : $query->the_post(); diff --git a/layouts/service-section.php b/layouts/service-section.php index 1921b58..5f93200 100644 --- a/layouts/service-section.php +++ b/layouts/service-section.php @@ -18,7 +18,7 @@ 'terms' => $category ) ) - ); + ); $count_service = 0; $query = new WP_Query($args); if($query->have_posts()): -- 2.17.1