Skip to content

Instantly share code, notes, and snippets.

@kachi
Created March 9, 2012 06:13
Show Gist options
  • Save kachi/2005303 to your computer and use it in GitHub Desktop.
Save kachi/2005303 to your computer and use it in GitHub Desktop.
<?php
$attachments = get_children(
array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'post_parent' => $post->ID
));
if(count($attachments) > 1) { ?>
<!-- 画像が複数ある場合。スライダー使うとか -->
<?php } else { ?>
<!-- 画像が1つ以下の場合はこちらで処理 -->
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment