public
Created

  • Download Gist
img.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<ul>
<?php
query_posts('post_type=menu_item&category_name=Special Rolls&orderby=title&order=ASC');
while ( have_posts() ) : the_post();
$images =& get_children('post_type=attachment&post_mime_type=image&post_parent='.$post->ID);
$img = array_shift($images);
$src = wp_get_attachment_image_src( $img->ID, 'full');
?>
<li>
<? if($src) { ?>
<h4><a href="<?= $src[0] ?>" rel="facebox"><? the_title() ?></a></h4> &mdash; <a href="<?= $src[0] ?>" rel="facebox"><? the_content() ?></a
<a href="<?= $src[0] ?>" rel="facebox"><img src="<? bloginfo('template_directory') ?>/images/icon-fullscreen.png"></a>
<? } else { ?>
<h4><? the_title() ?></h4> &mdash; <? the_content() ?>
<? } ?>
</li>
<?php endwhile; ?>
</ul>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.