diff --git a/archive-ofisuport-ajut.php b/archive-ofisuport-ajut.php
deleted file mode 100644
index 466972f..0000000
--- a/archive-ofisuport-ajut.php
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ 'OR');
- $meta_query[] = $query->get('meta_query');
- $fieldsearchvalues= explode(',', $_GET['os_fund_target']);
- foreach( $fieldsearchvalues as $fieldsearchvalue ){
- $os_search_value = $fieldsearchvalue; //'entitat-publica'; // whatever
- $os_field_value = sprintf( '^%1$s$|s:%2$u:"%1$s";', $os_search_value, strlen( $os_search_value ) );
-
- // add aur meta query to the original meta queries
- $meta_query[] = array(
- array(
- 'key' => 'os_fund_target',
- 'value' => $os_field_value,
- 'compare' => 'REGEXP',
- ),
- );
- }
- // update the meta query arguments
- $query->set('meta_query', $meta_query);
- }
-
- //always return
- return;
-}
diff --git a/inc/template-functions.php b/inc/template-functions.php
index 8a56ee3..3fc47f3 100644
--- a/inc/template-functions.php
+++ b/inc/template-functions.php
@@ -63,3 +63,72 @@ function xarxaprod_class_posttype (){
printf(get_post_type_object( get_post_type() )->rewrite['slug'] );
}
}
+/**
+ * Displays the FAQS subcategories from category id=1
+ */
+
+if ( ! function_exists( 'ofisuport_display_faqs_labels' ) ) :
+ function ofisuport_display_faqs_labels() {
+?>
+
+';
+ echo '
';
+ foreach ( $categories as $category ) {
+ if ( ! ($category->cat_ID == '1') ) { //cat_ID '1' is defined as default FAQ
+ echo '- ' . esc_html( $category->name ) . '
';
+ }
+ }
+ echo '
';
+ echo ' ';
+ }
+ }
+endif; //end ofisuport_display_each_faq_categories
+/**
+ * Display search form for FAQs
+ */
+
+if ( ! function_exists( 'ofisuport_display_faq_search' ) ) :
+ function ofisuport_display_faqs_search() {
+ // search form for category
+ // https://developer.wordpress.org/reference/functions/get_search_form/#comment-369
+ // https://wordpress.stackexchange.com/questions/313037/restrict-a-search-to-a-custom-post-type
+?>
+
+
@@ -38,53 +38,48 @@ get_header();
-
-
-
+
'xarxaprod-ajut',
- 'post_per_page' => '6'
- )
- );
- ?>
- have_posts() ) : ?>
- have_posts() ) : $the_query_ajut->the_post(); ?>
+ $the_query_ajut = new WP_Query(
+ array(
+ 'post_type' => 'xarxaprod-ajut',
+ 'posts_per_page' => '-1'
+ )
+ );
+ ?>
+ have_posts() ) : ?>
+ have_posts() ) : $the_query_ajut->the_post(); ?>
-
+
-','');
-// echo '';
-//$postmetas = get_post_meta(get_the_ID());
-// foreach($postmetas as $meta_key=>$meta_value) {
-// echo '' . $meta_key . '
:' . $meta_value[0] . '
';
-// } ;
-// echo '
';
-?>
+
+
+
-
-
-
-
-
-
+