Forum Replies Created
-
AuthorPosts
-
October 13, 2016 at 6:45 am in reply to: Fronted Search Setting [Filter boxes closed automatically after updating ] #10458
K15Lmk98
ParticipantHi Ernest,
thanks 1000+.In my opinion, I think it is a feature to be implemented permanently.
ASP is much more usable.Ticket closed.
Claudio_
October 10, 2016 at 4:43 pm in reply to: Fronted Search Setting options [esclude terms empty] #10422K15Lmk98
ParticipantHi Ernest,
This is a machine translation.
Like I said, it is strange that ‘parent’ => 0 does not work.
However I want to share the solution I found, if other users had my need.
[code]add_filter( ‘asp_fontend_get_taxonomy_terms’, ‘asp_filter_empty_terms’, 1, 3 );
function asp_filter_empty_terms($terms, $taxonomy, $args) {
if ( $taxonomy == ‘luoghi’ ) {
$terms = get_terms($taxonomy, array(
‘orderby’ => $args[‘orderby’],
‘order’ => $args[‘order’],
‘taxonomy’=> $taxonomy,
‘parent ‘ => 0,
‘hide_empty’ => 1
));
foreach ($terms as $key =>$singleTerm) :
$term = get_term_by(‘id’, $result->term_id, $taxonomy);
if ( $singleTerm->parent != 0 ) :
unset($terms[$key]);
endif;
endforeach;
return $terms;
}return $terms;
}[/code]Ticket chiuso. Thanks for the support, Claudio_
October 10, 2016 at 1:10 pm in reply to: Fronted Search Setting options [esclude terms empty] #10421K15Lmk98
ParticipantHi Ernest,
in fact it is really strange. I disabled some plugins that could interfere with ASP, but the result does not change.
I’m developing locally.
When I publish the site I send accesses.Thanks, Claudio_
October 10, 2016 at 12:31 pm in reply to: Fronted Search Setting options [esclude terms empty] #10418K15Lmk98
ParticipantHi Ernest,
Thanks for the filter.
I just wanted to take the term parent, and I modified the code with ‘parent’ => 0:[code]add_filter( ‘asp_fontend_get_taxonomy_terms’, ‘asp_filter_empty_terms’, 1, 3 );
function asp_filter_empty_terms($terms, $taxonomy, $args) {
if ( $taxonomy == ‘luoghi’ ) {
return get_terms($taxonomy, array(
‘orderby’ => $args[‘orderby’],
‘order’ => $args[‘order’],
‘taxonomy’=> $taxonomy,
‘parent ‘ => 0,
‘hide_empty’ => 1
));
}
return $terms;
}[/code]But strangely always returns the children – see screnshot –
You have a solution?
Thanks, Claudio_
October 7, 2016 at 3:15 pm in reply to: filter asp_query_args [ post_meta_filter: relation two custom field ] #10398K15Lmk98
ParticipantFantastic. It works.
ASP plugin is great.
Thanks Ernest 1000+
I have another question, but for this I will open a new ticket.
Good evening
October 7, 2016 at 2:49 pm in reply to: filter asp_query_args [ post_meta_filter: relation two custom field ] #10394K15Lmk98
ParticipantHi Ernest,
thanks for the quick response.Unfortunately it does not work. Does not return any posts, but use only one custom field.
Keys and values are correct, because they use the code Wp.
The posts are of a CPT
I am attaching two screenshots: “without_filter.png” and “filter.png”.
If you can do something, otherwise it is the same.
Thanks, Claudio_
-
AuthorPosts