Support » Fixing WordPress » Gallery not working and url link not clickable

  • Resolved naweedshams


    Hello everyone,

    I run a business video directory website.

    The photo gallery and youtube boxes used to be the other way around but since changing them for better viewing, the photo gallery has stopped working when I click on the small thunbnails.

    Also the website link should be clickable but not sure how to do that.

    Here is the code for my single post.php

    Template Name: Full Width
    <?php get_header(); ?>
    <div id="content">
    	<div id="contentwide">
    		<div class="postareawide">
            <?php include(TEMPLATEPATH."/breadcrumb.php");?>
            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
            <?php $args = array(
    							'order'          => 'ASC',
    							'post_type'      => 'attachment',
    							'post_parent'    => $post->ID,
    							'post_mime_type' => 'image',
    							'post_status'    => null,
    							'numberposts'    => -1,
    		$attachments = get_posts($args);
            	<div id="thepost">
                	<div class="left">
                    	<div class="address">
                            <p><?php the_title(); ?></p>
                            <p><?php echo get_post_meta($post->ID, "city_value", true); ?></p>
                            <p><?php echo get_post_meta($post->ID, "state_value", true); ?></p>
                            <p><?php echo get_post_meta($post->ID, "zip_value", true); ?></p>
                            <h3>Contact Details:</h3>
                            <p><strong>Tel:</strong> <?php echo get_post_meta($post->ID, "tel_value", true); ?></p>
                            <?php if (get_post_meta($post->ID, "email_value", true) != ""){ ?>
                            <p><strong>Email:</strong> <?php echo get_post_meta($post->ID, "email_value", true); ?></p>
                            <?php } ?>
                            <?php if (get_post_meta($post->ID, "website_value", true) != ""){ ?>
                            <p><strong>Website:</strong> <?php echo get_post_meta($post->ID, "website_value", true); ?></p>
                            <?php } ?>
                        <div id="photolarge">
                        	<div id="slideshow">
                            	<?php include 'tools/get_images.php'; ?>
                        		<img id="large" src="<?php echo bloginfo('template_url'); ?>/tools/timthumb.php?src=<?php bdw_get_images(); ?>&w=280&h=200&zc=1&q=100" alt="gallery" />
                        <div id="photothumbs">
    								<?php if ($attachments)
    										foreach ($attachments as $attachment)
    <script type="text/javascript">
    function changeLarge(theSrc){
    var thumbSrc = theSrc;
    var srcLength = thumbSrc.length;
    var lengthCalc = srcLength - 23;
    var finalSrc = thumbSrc.substr(0,lengthCalc);
    var theFinalSrc = finalSrc+"&w=280&h=200&zc=1&q=100";
    $("#large").attr({src: theFinalSrc});
    											 <img onclick="changeLarge($(this).attr('src'))" class="thumb"
                                                 src="<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo wp_get_attachment_url($attachment->ID);?>&w=30&h=30&zc=1&q=50" alt="<?php the_title(); ?>" />
    										echo "<p>There are no images at the moment.</p>";
                            <?php include 'tools/maps.php'; ?>
                            <div id="location">
                            <h3>Location Map</h3>
                            <div id="mapsearch">Loading...</div>
                        <div class="review">
                            <p><?php the_content(); ?></p>
                        <div id="postcomment">
                        	<h3>User Reviews</h3>
                            <?php comments_template(); ?>
                    <div class="right">
                        <div class="youtube">
                            <h3>Promotional Video</h3>
                            <?php if (get_post_meta($post->ID, "youtube_value", true) != ""){ ?>
                            	<?php echo get_post_meta($post->ID, "youtube_value", true); ?>
                            <?php } else { ?>
                            <p align="center">Video coming soon!</p>
                            <?php } ?>
                        <?php if (get_post_meta($post->ID, "advert_value", true) != ""){ ?>
                        <div id="advert">
                        	<a href="<?php echo get_post_meta($post->ID, "advertlink_value", true); ?>">
                            	<img src="<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo get_post_meta($post->ID, "advert_value", true); ?>&w=385&h=455&zc=1&q=100" alt="Business Advert" />
                        <?php } ?>
        		<div class="clear"></div>
                <?php endwhile; else: ?>
    				<p><?php _e('Sorry, no posts matched your criteria.', 'studiopress'); ?></p>
    			<?php endif; ?>
    <?php get_footer(); ?>

    Will be very happy if anyone helps me fix it 🙂

    Thank you,


Viewing 6 replies - 1 through 6 (of 6 total)
  • naweedshams


    can anyone help?

    Robert Chapin


    I suggest running your page through the HTML validator for some tips, because this code you pasted is missing a lot of required syntax.

    Robert Chapin


    The only thing I can say more specific than that is you have some really bizarre javascript in there…

    var lengthCalc = srcLength - 23;

    I’m not sure what that was supposed to do, but what it is doing now is deleting parts of the thumbnail links.




    For the gallery, in the script try changing:

    var lengthCalc = srcLength - 23;


    var lengthCalc = srcLength - 20;

    and as for making your header clickable you need to change the link so it has the same height as the background image, something like:

    #header #imageheader h4 a{ display:block; height:135px; }

    But you have a pargraph afterwards which could affect it. so either move that in the link or get rid of it, just make an adjusment of some sort!



    I appreciate the helpful replies guys.

    @ xdesi, the logo link isn’t much of a worry as it’s still clickable on the very top area.

    It’s in this link:

    If you look at the left side where it says contact details, the email and web address should be clickable where as now it’s just plain text.

    Thank you for the responses!




Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Gallery not working and url link not clickable’ is closed to new replies.