gigi Posted February 9, 2010 Share Posted February 9, 2010 Hi I'm new here and have no idea about coding whatsoever. I have a wordpress theme that has the smoothgallery script included in it. Currently, the script calls the title and photos from featured post on my blog. ( custom field name set to featured and image url) I want to be able to create my own titles and not have them called from my blog post titles. As a workaround I attempted to create a blog post and date it from a year or two ago (as I want my readers to see the photo and photo titles in my gallery but I don't want them to be able to view the post itself. needless to say, it didn't work because I think the script only uses recent posts. anyway, I need some help editing the script so that: 1. I can create my own photo titles and not have the titles automatically come from my blog post title or 2. be able to have photos come from a hidden back dated post. Here is the script: <!--INITIALIZE SMOOTH GALLERY--> <script type="text/javascript"> function startGallery() { var myGallery = new gallery($('myGallery'), { timed: true, showCarousel: false }); } window.addEvent('domready', startGallery); </script> <? global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?> <div id="myGallery"> <?php #RETRIEVE THE SMOOTH GALLERY POSTS $smoothgallery_posts = new WP_Query("category_name=$theme_featured&posts_per_page=5"); #DISPLAY SMOOTH GALLERY ELEMENTS while($smoothgallery_posts->have_posts()) { $smoothgallery_posts->the_post(); #RETRIEVE THE SMOOTH GALLERY IMAGE URL $picture = get_post_meta($post->ID, 'featured', true); #RETRIEVE THE SMOOTH GALLERY URL $url = get_post_meta($post->ID, 'url', true); #SMOOTH GALLERY IMAGE URL EXISTS if(!empty($picture)) { ?> <!-- SMOOTH GALLERY ELEMENT - START --> <div class="imageElement"> <h3></h3> <?php the_excerpt(); ?> <?php #SMOOTH GALLERY URL EXISTS if(!empty($url)) { ?> <a href="<?php echo $url; ?>" title="Read more" class="open"></a> <?php } #SMOOTH GALLERY URL DOES NOT EXIST - USE POST URL else { ?> <a href="<?php the_permalink(); ?>" title="Read more" class="open"></a> <?php } ?> <img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo get_post_meta($post->ID, "featured", true); ?>&h=280&w=490&zc=0&q=85" class="full" alt="<?php ; ?>"/> <img src="<?php echo $picture; ?>" class="thumbnail" alt="<?php ; ?>"/> </div> <!-- SMOOTH GALLERY ELEMENT - END --> <?php } } ?> </div> Here is a demo of the theme http://54800.com/ Thanks everyone! Link to comment https://forums.phpfreaks.com/topic/191518-help-with-php-smooth-gallery-script/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.