Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mula4

    (@mula4)

    @tseitan Έχω την εντύπωση ότι τελικά αλλάξαμε τους live κωδικούς.
    Χωρίς να είμαι 100% σίγουρος πάντως.

    Thread Starter mula4

    (@mula4)

    Ευχαριστώ πολύ για την απάντηση, θα επικοινωνήσω με την τράπεζα.
    Καλή συνέχεια.

    The final code that worked is ”

    foreach ( $terms as $category ) {
    $color = ColorfulCategories::getColorForTerm($category->term_id);
    $term_list .= ‘<a class=”col-12 col-md-12 col-lg-6″ style=”background-color: ‘.
    $color .'” href=”‘ . esc_url( get_term_link( $category ) ) . ‘” alt=”‘ .
    esc_attr(
    sprintf( __( ‘View all post filed under %s’, ‘my_localization_domain’ ),
    $category->name ) ) . ‘”>’ . $category->name . ‘‘;
    }
    echo $term_list;?>

    thank you very much for your help!

    Hello,

    i tried but the generated code is the code below.

    http://prntscr.com/nafujb

    How can i use the value $color as a background color of the tag?

    Hello , i display my categories like this.

    <?php

    $terms = get_terms( ‘arthra_categories’);

    foreach ( $terms as $category ) {
    $term_list .= ‘<a class=”col-12 col-md-12 col-lg-6″ href=”‘ . esc_url(
    get_term_link( $category ) ) . ‘” alt=”‘ . esc_attr( sprintf( __( ‘View all post
    filed under %s’, ‘my_localization_domain’ ), $category->name ) ) . ‘”>’ .
    $category->name . ‘‘;

    }
    echo $term_list;?>

    I think i should put the code get_term_meta($term_id, ‘cc_color’, true); under $terms = get_terms( ‘arthra_categories’);

    But then what i will have to do?

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)