• 19-12-2012, 20:51:57
    #1
    Yükledigim ortam dosyasının sayısını ana sayfada nasıl gösterebilirim bilen varmı acaba ??

    Aşağıdaki sayı.
  • 19-12-2012, 21:45:50
    #2
    bu şekilde çekebilirsin.
    <?php 
    global $post;
    $ekler = get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) );
    $s = count( $ekler );
    echo $s;
    ?>
  • 19-12-2012, 22:34:22
    #3
    cudjex adlı üyeden alıntı: mesajı görüntüle
    bu şekilde çekebilirsin.
    <?php 
    global $post;
    $ekler = get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) );
    $s = count( $ekler );
    echo $s;
    ?>
    0 olarak gösteriyor hocam kodu ekleyince :S
  • 20-12-2012, 21:55:52
    #4
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Şöyle yazalım;

    functions.php dosyasına ekleyin:

    function xclusive(){
            $xclsv = array('post_type' => 'attachment','post_mime_type' =>array('jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png',), 'post_status' => 'inherit', 'posts_per_page' => -1,);
            $xclsv2 = new WP_Query( $xclsv );
            echo $xclsv2->post_count;
    }

    Sayının gösterime gireceği yere ekleyin:

    <?php xclusive(); ?>
  • 20-12-2012, 23:02:47
    #5
    xcLuSive adlı üyeden alıntı: mesajı görüntüle
    Şöyle yazalım;

    functions.php dosyasına ekleyin:

    function xclusive(){
            $xclsv = array('post_type' => 'attachment','post_mime_type' =>array('jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png',), 'post_status' => 'inherit', 'posts_per_page' => -1,);
            $xclsv2 = new WP_Query( $xclsv );
            echo $xclsv2->post_count;
    }

    Sayının gösterime gireceği yere ekleyin:

    <?php xclusive(); ?>
    Teşekkürler hocam Allah razı olsun .