Jump to content

Wordpress Gallery - Linking images with story - Please Help!


Recommended Posts

Hi everyone,

 

I really hope someone can help me.  I just need an explanation on how to link pictures/stories to the gallery I have on my wordpress blog home page.  The stories seem to link up automatically, but it just keeps showing the default image.  Here is the code for that gallery:

<?php
/*
File Name: Widget
Version: 1.02
*/

require('../../../../wp-blog-header.php');
// IMPORTANT :
// if you don't put this file in your blog root (where your index.php is)
// then modify the path to wp-blog-header.php above
if (!headers_sent()) {
header('Expires: Mon, 23 Mar 1972 07:00:00 GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Slideshow</title>
	<link rel="stylesheet" href="css/layout.css" type="text/css" media="screen" charset="utf-8" />
	<link rel="stylesheet" href="css/jd.gallery.css" type="text/css" media="screen" charset="utf-8" />
	<script src="scripts/mootools.v1.11.js" type="text/javascript"></script>
	<script src="scripts/jd.gallery.js" type="text/javascript"></script>
</head>
<body>
	<script type="text/javascript">
		function startGallery() {
			var myGallery = new gallery($('myGallery'), {
				timed: true
			});
		}
		window.addEvent('domready',startGallery);
	</script>
	<div class="content">
		<div id="myGallery">
			<?php 
			$my_query = new WP_Query('showposts=8');//new WP_Query('showposts='. ;
			$fas = 1;
			while ($my_query->have_posts()) : $my_query->the_post();
				$do_not_duplicate = $post->ID; 
				if ( get_post_meta($post->ID, 'image', true) ) { 
					$g = get_bloginfo("template_directory") . "/thumb.php?src=" . get_post_meta($post->ID, "image", true) . "&h=297&w=394&zc=1&q=100";
				}else{
					$g = get_bloginfo("template_directory") . "/images/demo/demo-tabs.gif";
				}
			?>
			<div class="imageElement">
				<h3><span><?php the_time("F jS, Y");?></span><?php the_short_title(30);?></h3>
				<p> </p>
				<a href="<?php the_permalink();?>" title="Open Post" class="open" target="_parent"></a>
				<img src="<?php echo $g;?>" class="full" />
				<img src="<?php echo $g;?>" class="thumbnail" />
			</div>				
			<?php
			endwhile;
			?>
		</div>
	</div>
</body>
</html>

 

 

Thanks a lot in advance.  This has been a thorn in my side since I started it.  Thanks!!!!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.