• Resolved Houdini

    (@romariokg)


    I need to display an image corresponding to a category on a sheet’s archive page, thereby replacing the default category icon. It was necessary to display images for each relevant category. How can I do this? If I take the code from the code in the widgets, an error occurs.

        <?php if ( $display['cat'] ): ?>
                    <li><i class="fa fa-tag" aria-hidden="true"></i><a href="<?php echo esc_url( Link::get_category_page_link( $category ) ); ?>"><?php echo esc_html( $category->name ); ?></a></li>
                <?php endif; ?>

    /wp-content/themes/classilist-child/classified-listing/custom/list-items/archive-list-1.php

    What needs to be added to this code so that instead of: <i class=”fa fa-tag” aria-hidden=”true”></i> Is there a category image?

    • This topic was modified 3 months, 2 weeks ago by Houdini.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Ali Akbar Reyad

    (@alireyad)

    Hi,
    Please, create ticket from our site for premium products.

    Thank you

    Thread Starter Houdini

    (@romariokg)

    Hi, I created a ticket about this, they don’t want to help me on this issue They say that, sorry, this is not possible now, we will do it in future updates!

    Although I think it’s not difficult!

    Thread Starter Houdini

    (@romariokg)

    Support response ((

    We are already working it, hopefully it will be fixed in the next theme update.

    Plugin Support Ali Akbar Reyad

    (@alireyad)

    Hi,
    Okay, I will check it.

    Thank you

    Thread Starter Houdini

    (@romariokg)

    Hello Ali Akbar! This problem is solved! I’ll leave the code for displaying category images here. Help me find a solution to the remaining issues. Thank you!

    <?php if ( $display['cat'] ) : ?>
    <div class="rtin-cat-wrap">
    <?php
    $image_id = get_term_meta($category->term_id, '_rtcl_image', true);

    if ($image_id) {

    $image_url = wp_get_attachment_url($image_id);

    if ($image_url) {
    echo '<img src="' . esc_url($image_url) . '" class="rtin-cat-img" alt="' . esc_attr($category->name) . '" />';
    }
    }
    ?>
    </div>
    <?php endif; ?>

    Thread Starter Houdini

    (@romariokg)

    Using the same method, it was possible to display an icon in the template

    <?php if ( $display['cat'] ) : ?>
    <div class="rtin-cat-wrap">
    <?php
    $icon_id = get_term_meta( $category->term_id, '_rtcl_icon', true );

    if ( $icon_id ) {

    echo '<span class="rtin-cat-icon rtcl-icon rtcl-icon-' . esc_attr( $icon_id ) . '"></span>';
    }
    ?>

    <a class="rtin-cat" href="<?php echo esc_url( Link::get_category_page_link( $category ) ); ?>">
    <?php echo esc_html( $category->name ); ?>
    </a>
    </div>
    <?php endif; ?>
    Plugin Support Ali Akbar Reyad

    (@alireyad)

    Good job. Hope, it will help others also.

    Thank you

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.