Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • aureliebear-to-bearnet

    (@aureliebear-to-bearnet)

    Ok, my problem is resolved ! ??
    Here is the code I added on my file “single.php” :

    <?php
    $attachments = get_children(array('post_parent'=>$post->ID));
    $nbImg = count($attachments);
    echo 'There are '.$nbImg.' pictures on this post.';
    ?>

    Thx for your ideas ! ??

    aureliebear-to-bearnet

    (@aureliebear-to-bearnet)

    Hello everybody,

    Is there somebody who managed to count the number of attachment files (images) in a post ? Is there a function in WordPress which allow to display it (something like “wp_get_attachment_number();”) ?
    I would like to display this variable in the file “single.php”…

    Thx for your help ! ??

    BR,
    Aurélie D.

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