This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • K15Lmk98K15Lmk98
    Participant

    Hi Ernest,
    thanks 1000+.

    In my opinion, I think it is a feature to be implemented permanently.
    ASP is much more usable.

    Ticket closed.

    Claudio_

    in reply to: Fronted Search Setting options [esclude terms empty] #10422
    K15Lmk98K15Lmk98
    Participant

    Hi 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_

    in reply to: Fronted Search Setting options [esclude terms empty] #10421
    K15Lmk98K15Lmk98
    Participant

    Hi 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_

    in reply to: Fronted Search Setting options [esclude terms empty] #10418
    K15Lmk98K15Lmk98
    Participant

    Hi 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_

    K15Lmk98K15Lmk98
    Participant

    Fantastic. It works.

    ASP plugin is great.

    Thanks Ernest 1000+

    I have another question, but for this I will open a new ticket.

    Good evening

    K15Lmk98K15Lmk98
    Participant

    Hi 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_

Viewing 6 posts - 1 through 6 (of 6 total)