Forum Replies Created

Viewing 3 replies - 31 through 33 (of 33 total)
  • How could you use that code to display on the attachement page and show ho many attachments are attached to the parent? What I’m trying to accomplish is to display “Image #3 of 5” when viewing the single attachment through the image.php template.

    Thread Starter mattloak

    (@mattloak)

    oh, and I tried it without the echo too and got the same error.

    Thread Starter mattloak

    (@mattloak)

    Thanks. My php is a little rusty so I couldn’t get this to work. There appeared to be some errors in that code too. I cleaned it up as best I could and tried this:

    <?php echo $args = array(
    'post_type' => 'attachment',
    'post_mime_type' => 'image'
    )
    $images = get_children ($args);
    $count = count ($images); ?>

    But I’m getting and error that says:

    Parse error: syntax error, unexpected T_VARIABLE, expecting ‘,’ or ‘;’

    on this line: $images = get_children ($args);

    Any help fixing this would be appreciated.

Viewing 3 replies - 31 through 33 (of 33 total)