Default image link issue

wordpress

#1

Hi users,
When making new posts, the feature image links by default to the site root (scribblegraph.me) rather than to the intended post. Visitors can access the post by clicking on the post title, but not by clicking on the image which is obviously ideal.

I cannot find where this is changed. Ideas?

Possible conflicts? Activated plug-ins:
Theme: Pinboard v1.0.6
NextGEN Gallery Version 1.9.12 By Photocrati
Regenerate Thumbnails Version 2.2.4 by Viper007Bond


#2

Oh my god, those are great drawings! (I have huge artist envy for drawing skills - http://www.scribblegraph.me/dalek/ is totally awesome.)

I think it’s the theme. Someone else on WordPress.org mentioned this.

in your theme’s function.php, look for this on line 1823:

                                <figure>
                                        <a href="<?php echo $image[0]; ?>" title="<?php the_title_attribute(); ?>" class="colorbox"  rel="attachment">
                                                <?php echo wp_get_attachment_image( $attachment->ID, 'image-thumb' ); ?>
                                        </a>
                                </figure>

Change this:

to this:

I think that’s where it’s set.

From: http://wordpress.org/support/topic/link-image-to-post-from-main-page-when-using-image-format?replies=9


#3

Hi Ipstenu - I’ve made that change to ‘Theme Functions’ (functions.php) - I assume that is called when the post is made, so all existing posts wont’ reflect that change?

I’ll have to scribble something new today to see if it has done the job;) Thanks kindly!


#4

It should work retroactively for all posts, so if it’s not working that may not be the right line. Darn.

You’re using caching, though, so try flushing the cache.


#5

Hi Ipstenu - flushing the cache was the first thing I did after making the edit no joy!

Should I un-edit that edit?

I’m pretty set on this theme, it works well with the content. Definitelya theme issue? If so, i might chase a solution with the theme devs.


#6

You could possibly alter the page/pages so that the entire square (image, text and title) are all one link. This would be more friendly to a touch-interface.

You could do something like when you hover over that square, it turns a slight shade of gray or some other color.

Not too difficult to change in the page-template files. It looks like mainly your home-page is where you are using those featured images.
[hr]
The code in your page-template for your home-page (could be home.php, index.php or front-page.php…or a custom page template) will have something like:

<div class="entry">
<figure>
<?php if ( has_post_thumbnail()) : ?>

	<?php the_post_thumbnail('post-image'); ?>

<?php endif; ?>
</figure>
<div class="entry-container">
<header class="entry-header">
<h2 class="entry-title"><a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_content(); ?>"><?php the_title(); ?></a></h2>
</header><!-- .entry-header -->
<div class="entry-summary">
<?php the_excerpt(); ?>  
</div><!-- .entry-summary -->
<div class="clear"></div>
</div><!-- .entry-container -->
</div><!-- .entry -->

that you could change to something like:

<a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_content(); ?>">
<div class="entry">
<figure>
<?php if ( has_post_thumbnail()) : ?>

	<?php the_post_thumbnail('post-image'); ?>

<?php endif; ?>
</figure>
<div class="entry-container">
<header class="entry-header">
<h2 class="entry-title"><?php the_title(); ?></h2>
</header><!-- .entry-header -->
<div class="entry-summary">
<?php the_excerpt(); ?>  
</div><!-- .entry-summary -->
<div class="clear"></div>
</a>

where i just put the link tags around that entry div rather than around the title. Might need to tweak some CSS slightly