• 29-05-2022, 21:31:23
    #1
    Türleri gösterirken sondaki virgülü nasıl kaldırabilirim

     foreach($terms as $term) {
                $post_term_box .= "<a class=\"turlink\" href='".get_bloginfo('url')."/".$term->taxonomy."/".$term->slug."' title='".$term->name."'>".$term->name.", </a>";
                }
  • 29-05-2022, 21:35:21
    #2
    sondaki virgül'ü önce kaldırın, sonra altta yazdığım css kodu ile kolayca halledebilirsiniz.
    .turlink:not(:last-child):after {
     content: ' , ';
    }
  • 29-05-2022, 21:36:44
    #3
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Çok bilgim yok fakat bu olabilir mi?

    foreach($terms as $term) {
    $post_term_box .= "<a rel='nofollow noreferrer ugc' class="turlink" href='".get_bloginfo('url')."/".$term->taxonomy."/".$term->slug."' title='".$term->name."'>".$term->name." </a>";
    }
  • 29-05-2022, 22:43:14
    #4
    $post_term_box .= rtrim("<a class=\"turlink\" href='".get_bloginfo('url')."/".$term->taxonomy."/".$term->slug."' title='".$term->name."'>".$term->name.", </a>", ",");

    bunu bi dene hocam.
  • 30-05-2022, 17:53:28
    #5
    Burda nasıl düzenleyebilirim
                    <?php
                                $terms = get_the_terms( $post->ID, 'tur' );
                                if ($terms) {
                                    foreach($terms as $term) {
                                    echo "<a href='".get_bloginfo('url')."/".$term->taxonomy."/".$term->slug."' title='".$term->name."'>".$term->name." </a>";
                                    }
                                }?>