WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Gallery not working and url link not clickable (7 posts)

  1. naweedshams
    Member
    Posted 4 years ago #

    Hello everyone,

    I run a business video directory website.

    http://www.visitlocal.co.uk/index.php/2009/12/08/get-bike/

    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

    <?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">
    
                            <h3>Address</h3>
                            <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><!--address-->
    
                        <h3>Photos</h3>
    
                        <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>
    
                        </div>
    
                        <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});
    }
    </script>
    											 <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(); ?>" />
    
    										<?php
    										}
    									}
    									else
    									{
    										echo "<p>There are no images at the moment.</p>";
    									}
    									?>
    
                        </div>
    
                            <?php include 'tools/maps.php'; ?>
                            <div id="location">
                            <h3>Location Map</h3>
                            <div id="mapsearch">Loading...</div>
                            </div>
    
                        <div class="review">
    
                        	<h3>Description</h3>
    
                            <p><?php the_content(); ?></p>
    
                        </div><!--review-->
    
                        <div id="postcomment">
    
                        	<h3>User Reviews</h3>
    
                            <?php comments_template(); ?>
    
                        </div><!--comments-->
    
                    </div><!--left-->
    
                    <div class="right">
    
                    	</div><!--address-->
    
                        <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 } ?>
                        </div><!--youtube-->
    
                        <?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" />
                            </a>
    
                        </div>
                        <?php } ?>
    
                    </div><!--right-->
    
        		<div class="clear"></div>
    			</div><!--thepost-->
    
                <?php endwhile; else: ?>
    
    				<p><?php _e('Sorry, no posts matched your criteria.', 'studiopress'); ?></p>
    
    			<?php endif; ?>
    
    		</div><!--postareawide-->
    
    	</div><!--contentwide-->
    
    </div><!--content-->
    
    <?php get_footer(); ?>

    Will be very happy if anyone helps me fix it :)

    Thank you,

    N

  2. naweedshams
    Member
    Posted 4 years ago #

    can anyone help?

  3. Robert Chapin
    Member
    Posted 4 years ago #

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

  4. Robert Chapin
    Member
    Posted 4 years ago #

    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.

  5. xdesi
    Member
    Posted 4 years ago #

    Hi,

    For the gallery, in the script try changing:

    var lengthCalc = srcLength - 23;

    To:

    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!

  6. naweedshams
    Member
    Posted 4 years ago #

    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:
    http://www.visitlocal.co.uk/index.php/2009/12/08/get-bike/

    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!

  7. naweedshams
    Member
    Posted 4 years ago #

    bump!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.