Support

Account

Forum Replies Created

  • Thanks ohn Huebner for your answers.
    I finally find a solution!!!
    The code that worked is this:

    $imgcategory = get_field( 'imagen_de_categoria', 'category_'. $category->term_id ) ;
        echo '<div class="menu_section_parallax" style="background-image: url( ' .$imgcategory. ' )"></div>';

    I´m not sure why it needs the ‘category_’ parameter: if you know it will be very helpfull for the future (my learning future) if you can explain it to me.
    If you can´t, thank you anyway!!

  • Thank so much for your answers.

    Anyway, is this correct?

    $imgcategory = get_field('imagen_de_categoria', $category);
    
        echo '<div class="menu_section_parallax" style="background-image: url( '.$imgcategory. ' )"></div>';

    Or this?
    echo '<div class="menu_section_parallax" style="background-image: url( '.get_field('imagen_de_categoria', $category). ' )"></div>';

    Because the images are not showing

  • Hi!
    I´ve made a custom filed for taxonomy term as category. In fact the image input appears correctly in each category and I´ve uploaded images for them.
    My problem is that I dont´t find a way to show the images in this part of the code:
    echo ‘<div class=”menu_section_parallax” style=”background-image: url(”)”></div>’;
    My idea was to put the custom field code in the background-image url
    I´ve tried several solutions I found online but anything works, probably because I´ve made syntax errors or maybe because my approach is wrong.

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