fbpx
-50% OFF Black Friday coupon: BF2021

Theme settings Presets Term ID not working

HomeTopicsSupport forumTheme settings Presets Term ID not working
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16126
    Avatar
    rrogers
    Participant

    Hi there,

    The term id option in the theme Settings Presets is not working. When I select for instance term id -> equal -> categoryname and then click save preset , the selected category is not saved.

    Attachments:
    You must be logged in to view attached files.
    #16131
    Artem Temos
    Artem Temos
    Keymaster

    Hello,

    There is a bug in our theme. To fix this, you need to edit the file framework/includes/options/class-presets.php and replace the following part

    if ( 'term_id' === $rule['type'] && ! empty( $rule['value_id'] ) ) {
        $term_object = false;
        $taxonomies = get_taxonomies();
        foreach ( $taxonomies as $tax_type_key => $taxonomy ) {
            $term_object = get_term_by( 'id', $rule['value_id'], $taxonomy );
            if ( ! $term_object ) {
                break;
            }
        }
        if ( $term_object ) {
            $title = $term_object->name;
        }
    }

    with this

    if ( 'term_id' === $rule['type'] && ! empty( $rule['value_id'] ) ) {
        $taxonomies = get_taxonomies();
        foreach ( $taxonomies as $taxonomy ) {
            $term_object = get_term_by( 'id', $rule['value_id'], $taxonomy );
            if ( $term_object ) {
                $title = $term_object->name;
            }
        }
    }

    Kind Regards

    #16134
    Avatar
    rrogers
    Participant

    Thank you! It is working now!

    #16135
    Artem Temos
    Artem Temos
    Keymaster

    Great, you are welcome!

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

The topic ‘Theme settings Presets Term ID not working’ is closed to new replies.

Sign in

No account yet?

Create an Account