Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
jorge | 9e65df4df2 | |
jorge | d05eb07c41 | |
jorge | 624ceeafd2 | |
jorge | e51f837ba8 | |
jorge | c2c7a7bb0f | |
jorge | bce9973189 | |
jorge | 9d61a34d7e | |
jorge | 21530c37d2 |
|
@ -46,8 +46,9 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form') ) {
|
||||||
|
|
||||||
// check for values in url and get value if available
|
// check for values in url and get value if available
|
||||||
if( isset($_GET[ $fieldname ]) ) {
|
if( isset($_GET[ $fieldname ]) ) {
|
||||||
|
|
||||||
$filteredvalues['value'] = explode(',', $_GET[ $fieldname ]);
|
$filteredvalues['value'] = explode(',', $_GET[ $fieldname ]);
|
||||||
|
} else {
|
||||||
|
$filteredvalues['value'] = [];
|
||||||
};
|
};
|
||||||
//end check for values in url
|
//end check for values in url
|
||||||
|
|
||||||
|
@ -55,12 +56,12 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form') ) {
|
||||||
if( $fieldname == $fields['name']) {
|
if( $fieldname == $fields['name']) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section id="fund-filter-<?php echo $fields['name']; ?>" class="<?php echo $fields['name']; ?>">
|
<section id="fund-filter fund-filter-<?php echo $fields['name']; ?>" class="<?php echo $fields['name']; ?>">
|
||||||
<h5><?php echo $fields['label'];?></h5>
|
<h5 class="oficinasuport-titol-opcions"><?php echo $fields['label'];?></h5>
|
||||||
<?php foreach( $fields['choices'] as $choicevalue => $choicelabel ) { ?>
|
<?php foreach( $fields['choices'] as $choicevalue => $choicelabel ) { ?>
|
||||||
|
|
||||||
<div class="filter" data-filter="<?php echo $fields['name'];?>">
|
<div class="filter" data-filter="<?php echo $fields['name'];?>">
|
||||||
<input class="ofisuport-filter" type="checkbox" name="<?php echo $fields['name'];?>" <?php if( in_array($choicevalue,$filteredvalues['value']) ) { echo 'checked';}; ?> value="<?php echo $choicevalue ?>" />
|
<input class="ofisuport-filter" type="checkbox" name="<?php echo $fields['name'];?>" <?php if( in_array( $choicevalue, $filteredvalues['value']) ) { echo 'checked'; } ?> value="<?php echo $choicevalue; ?>" />
|
||||||
<label for="<?php echo $choicevalue; ?>"><?php echo $choicelabel;?></label>
|
<label for="<?php echo $choicevalue; ?>"><?php echo $choicelabel;?></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -84,7 +85,21 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form') ) {
|
||||||
<?php //close the form and subit ?>
|
<?php //close the form and subit ?>
|
||||||
|
|
||||||
<?php }; //end if groupkey ?>
|
<?php }; //end if groupkey ?>
|
||||||
|
<aside id="search-form-ajuts" class="ofisuport-search-ajuts">
|
||||||
|
<?php
|
||||||
|
// search form for custom post type 'oficinasuport-ajut'
|
||||||
|
// <input type="hidden" value="ofisuport-ajut" name="post_type" id="post_type" />
|
||||||
|
// https://developer.wordpress.org/reference/functions/get_search_form/#comment-369
|
||||||
|
// https://wordpress.stackexchange.com/questions/313037/restrict-a-sear ch-to-a-custom-post-type
|
||||||
|
?>
|
||||||
|
<form class="ofisuport-search-form" role="search" method="get" action="/">
|
||||||
|
<label class="screen-reader-text" for="search">Search in ajuts</label>
|
||||||
|
<input type="search" id="search" class="search-field" placeholder="cerca amb paraula clau..." value="<?php the_search_query(); ?>" name="s" />
|
||||||
|
<input type="submit" id="searchsubmit" class="search-submit" value="cerca">
|
||||||
|
<span class="ofisuport-search-submit ofisuport-icon-search"></span>
|
||||||
|
<input type="hidden" value="ofisuport-ajut" name="post_type" id="post_type" />
|
||||||
|
</form>
|
||||||
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
Loading…
Reference in New Issue