Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter vladruswork

    (@vladruswork)

    @bcworkz ,

    Thank you for the explanation! The last bit of my problem would then be if I could write some custom code for the breadcrumbs so that the user can go back from which category he came from. As of now my breadcrumbs will only show the main category I have selected, meaning if the user clicks from category A BUT the main category is category B, breadcrumbs do not update so they still show Home > category B.

    What I’d like it to be is that if my user clicks from category A, the breadcrumbs show Home > category A, and if he clicks from category B, they show Home > category B. If you have any ideas I’d love to hear them.

    Thread Starter vladruswork

    (@vladruswork)

    Hi @redfra7 ,

    Thanks for the tip, unfortunately I have tried this before but the result isn’t what I had hoped for, as you can see in the image, even though I’m on the hotel category, my link still points towards another category, and this is the behavior I’m trying to fix.

    <?php
    while (have_posts()) {
    the_post(); ?>

    <div class="category-container">
    <div class="category-box">
    <div class="category-photo-box">
    <img class="category-photo" src="<?php the_post_thumbnail_url('categoryPhoto'); ?>" alt="" />
    </div>
    <div class="category-content">
    <div class="category-title-link-box">
    <div class="category-title-box">
    <h2 class="category-title"><?php esc_attr(the_title()); ?></h2>
    <img src="<?php echo get_template_directory_uri(); ?>/img/card-slides-rating.svg" alt="" />
    </div>
    <div class="category-link-box">
    <a href="<?php the_field('website_link'); ?>" target="_blank">
    Vezi site-ul
    </a>
    <button>
    <a href="<?php the_field('website_link'); ?>">
    <img src="<?php echo get_template_directory_uri(); ?>/img/external-link.svg" alt="" />
    </a>
    </button>
    </div>
    </div>
    <div class="category-desc">
    <p>
    <?php echo esc_attr(wp_trim_words(get_the_excerpt(), 18)); ?>
    </p>
    </div>
    <div class="category-buttons">
    <div class="category-read-more">
    <a class="read-more-link" href="<?php esc_url(the_permalink()); ?>">Vezi mai multe<span
    class="clickable-div"></span></a>
    <img src="<?php echo get_template_directory_uri(); ?>/img/right-arrow.svg" alt="" />
    </div>
    <div class="category-save">
    <p class="save-text">Salvează</p>
    <img src="<?php echo get_template_directory_uri(); ?>/img/bookmark.svg" alt="" />
    </div>
    </div>
    </div>
    </div>
    </div>
    <?php }
    ?>

    This is the code I’m working with, maybe it helps, might be an issue with the_permalink(), maybe I need to use another function?

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