• 16-10-2020, 22:07:13
    #1
    Sadece belirlediğim bir kategoride içindekiler eklentisinin gözükmesini istiyorum nasıl yapabilirim?
    • ariferhan
    ariferhan bunu beğendi.
    1 kişi bunu beğendi.
  • 17-10-2020, 21:57:14
    #2
    Konu günceldir.
  • 17-10-2020, 23:05:00
    #3
    $args = array('cat'=>1);
    $the_query = new WP_Query( $args );
    
    // The Loop
    if ( $the_query->have_posts() ) {
    echo '<ul>';
    while ( $the_query->have_posts() ) {
    $the_query->the_post();
    echo '<li>' . get_the_title() . '</li>';
    }
    echo '</ul>';
    } else {
    // no posts found
    }
    /* Restore original Post Data */
    wp_reset_postdata();
    $args = array('cat'=>1);
    buradaki 1 kategori id'si. (https://developer.wordpress.org/refe...ory-parameters)

    Detay için: https://developer.wordpress.org/refe...sses/wp_query/
  • 19-10-2020, 09:27:11
    #4
    Nasıl kullanacağım?
  • 19-10-2020, 09:31:10
    #5
    nerede kullanmak istiyorsaniz onun template dosyasinda.

    category.php
    archive.php
    category-id.php
    category-slug.php