• Resolved Andry

    (@blackstar1991)


    ampwp-da6f1b84-56df-5e47-a773-2bdd49360295
    Hi, i have a problem with links of custom taxonomy on AMP version of site.
    In original version of site everysing ok
    https://joxi.ru/a2XNvMoUpzKOGr
    But when I use amp version I’ve got wrong links
    https://joxi.ru/E2pZQlxtjqJkar

    the code what I use

    
    
    <?php
        

    $terms = get_terms([
    'taxonomy' => 'vendors',
    'orderby' => 'name',
    'hide_empty' => false,
    ] );`

    if($terms){
    echo '<ul class="categories_list">';
    foreach ($terms as $term){

    $term_image = get_term_meta( $term->term_id, 'vendor_img', true);
    $imgUrl = wp_get_attachment_image_src( $term_image,'full')[0];
    if(!$imgUrl){
    $imgUrl = get_template_directory_uri() . '/images/no-image.svg';
    }
    echo "<li class='categories_item'>
    <a class='categories_link' href='{$term->slug}'>
    <img src='{$imgUrl}' width='370' height='200' alt='{$term- />name}'>
    <p>{$term->name}</p>
    </a>
    </li>";
    } echo '</ul>';` ?>

    How to fix this problem ?

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

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Creating wrong links for custom taxonomy’ is closed to new replies.