[Plugin: Shadowbox JS] Captions on custom post types
-
Hi,
I was wondering how I would be able to utilize the “Use Title from Image” from within a custom post template. The plugin seems to only be called from the_content() inside the loop.
The captions work fine on regular post types. Any help would be great, thanks.
<?php get_header(); ?> <h1><?php the_title(); ?></h1> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'twentyten' ), 'after' => '' ) ); ?> <?php endwhile; // end of the loop. ?> <div id="project-meta"> <h2>Information</h2> <?php foreach (simple_portfolio_info() as $key=>$info_item): $key = explode('_', $key); array_shift($key); $key = ucfirst(implode(' ', $key)); ?> <div class="box"> <span><?php echo $key; ?>:</span> <?php echo trim($info_item) == '' ? '...' : $info_item; ?> </div> <?php endforeach; ?> </div> <div id="project-media"> <h2>Media</h2> <?php foreach (simple_portfolio_media() as $media_item): ?> <?php switch ($media_item['type']): case 'image': $src = wp_get_attachment_image_src($media_item['value'], 'full'); echo "<a href=\"$src[0]\" rel=\"shadowbox[album]\" title=\"\">" . wp_get_attachment_image($media_item['value']) . "</a>"; break; case 'youtube': echo "<p>"; echo "<object width=\"480\" height=\"385\">"; echo " <param name=\"movie\" value=\"http://www.youtube.com/" . $media_item['value'] . "&hl=en_US&fs=1\"/>"; echo " <param name=\"allowFullScreen\" value=\"true\"/>"; echo " <param name=\"allowscriptaccess\" value=\"always\"/>"; echo " <embed src=\"http://www.youtube.com/v/" . $media_item['value'] . "&hl=en_US&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"385\"/>"; echo "</object>"; echo "</p>"; break; case 'snippet': echo $media_item['value']; break; endswitch; ?> <?php endforeach; ?> </div> <?php comments_template( '', true ); ?> <?php get_footer(); ?>
The topic ‘[Plugin: Shadowbox JS] Captions on custom post types’ is closed to new replies.