• kc257

    (@kchurch05)


    My site does NOT have the NextGen gallery plugin, but the core code itself is written into the theme (aparatus-v2) to show a revolving slider with the last 5 posts and their featured images.

    Currently my writer has to put in the photo credit at the top of each post so it appears in the gallery. I put together a custom field (“photo-credit”) so he’d only have to write it at the bottom, and it’d automatically be included in the post. (Also omits it from RSS feeds, which is why I don’t want him to have to write it at the top of each.)

    Here’s the code that calls the gallery:

    <?php if (is_paged()){echo 'style="display:none;"';} ?>>
    			<div id="myGallery">
    			<!--the loop-->
    			<?php query_posts(array('showposts' => 5, 'orderby'=> date, 'order' => DES, 'category_name' => $apa_feature_cat_name));
    					$saved_ids = array();
    					while (have_posts()) : the_post();
    					$values = get_post_custom_values("image"); ?>
    			...[WP 2.9 code]
    
    <!--define a gallery element if theres a custom image pictrue-->
    			<?php }elseif(isset($values[0]))	{?>
    				<div class="imageElement">
    					<h3><?php the_title(); ?></h3>
    					<?php the_excerpt(); ?>
    					<a href="<?php the_permalink() ?>" title="Go to Article" class="open"></a>
    ...

    I tried putting <?php echo get_post_meta($post->ID, ‘photo-credit’, true); ?> in before “the_excerpt,” but it’s not coming up with the custom field. (It works great on single.php, though.) I also tried using the code on this thread, but I’m not using either plugin so it doesn’t quite apply to it.

    Any ideas? ??

  • The topic ‘Custom fields to theme that uses NextGen Gallery code’ is closed to new replies.