Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

Post thumbnails no longer linking to posts


  #1  
Old Dec 8, 2016, 07:06 PM
poorboy
 
3 posts · Dec 2016
I upgraded to Wordpress 4.7 and now the thumbnails of my posts no longer link to the posts

Where as in the past I would see this in the code:

Code:
<div class="thumb-shadow"><div class="post-thumb"><a href="/post-url/"><img src="banner.png" width="740" height="253" alt="post title"/></a></div></div>
Now the /post-url/ part is blank like so:

Code:
<div class="thumb-shadow"><div class="post-thumb"><a href=""><img src="banner.png" width="731" height="286" alt="post title"/></a></div></div>
I see in postformat.php that this is the code

Code:
	<h2>
		<span class="post-format"></span>
		<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a>
	</h2>

	<?php bfa_thumb( 620, 180, true, '<div class="thumb-shadow"><div class="post-thumb">', '</div></div>' ); ?>
And that in Montezuma: thumb.php (includes/thumb.php):

Code:
	if( trim( $this_thumb ) != '' AND $this_thumb != FALSE ) {
		if( $link == 'permalink' ) 
			$this_thumb = '<a href="'.get_permalink( $id ).'">'.$this_thumb.'</a>';	
		echo $before . $this_thumb . $after;
I'm not sure what changed, or how to fix it.. any help?
  #2  
Old Dec 8, 2016, 09:37 PM
CrouchingBruin's Avatar
CrouchingBruin
 
299 posts · Aug 2010
Santa Monica, CA
I'm seeing the same thing on my test site, the href attribute for the thumbnail's anchor tag is empty, although the post title's link is OK. Good thing I haven't updated one of my production sites to WP 4.7 yet. Thanks for the heads up, I'm going to hold off on upgrading until there's a fix.
__________________
My Montezuma-themed sites: ESHS Girls Basketball Team, Venice Hongwanji Buddhist Temple
Please consider making a donation to BytesForAll for their great themes!
  #3  
Old Dec 9, 2016, 12:35 AM
CrouchingBruin's Avatar
CrouchingBruin
 
299 posts · Aug 2010
Santa Monica, CA
I've come up with a temporary workaround until the code is fixed.

At first, I tried surrounding the call to bfa_thumb() with an anchor tag that calls the_permalink:
Code:
<a href="<?php the_permalink(); ?>">
<?php bfa_thumb( 620, 180, true, '<div class="thumb-shadow"><div class="post-thumb">', '</div></div>'); ?>
</a>
This did not work, because bfa_thumb() outputs an anchor tag of its own, and you cannot nest anchor tags (it's syntactically incorrect).

So then I looked at the documentation for bfa_thumb, and it says that the last argument in the function is $link, and the default value for $link is permalink, which is supposed to indicate that an anchor tag that points to the post is to be output. If you pass in an empty string for $link though, the function won't output an anchor tag, and adding an enclosing anchor tag (with a call to the_permalink) will work:
Code:
<a href="<?php the_permalink(); ?>">
<?php bfa_thumb( 620, 180, true, '<div class="thumb-shadow"><div class="post-thumb">', '</div></div>', ''); ?>
</a>
So this snippet is just like the above one, except there's an empty string added as the last argument for the bfa_thumb() function to prevent it from outputting the anchor tag.
__________________
My Montezuma-themed sites: ESHS Girls Basketball Team, Venice Hongwanji Buddhist Temple
Please consider making a donation to BytesForAll for their great themes!

Last edited by CrouchingBruin; Dec 9, 2016 at 12:37 AM.
  #4  
Old Dec 9, 2016, 03:29 AM
poorboy
 
3 posts · Dec 2016
Quote:
Originally Posted by CrouchingBruin
Code:
<a href="<?php the_permalink(); ?>">
<?php bfa_thumb( 620, 180, true, '<div class="thumb-shadow"><div class="post-thumb">', '</div></div>', ''); ?>
</a>
When I try your temp fix, it pops some of the thumbnails out of the smaller box and makes them not fit neatly

If I recall correctly, this was an issue with Montezuma years ago that required a fix of some kind

Last edited by poorboy; Dec 9, 2016 at 03:55 AM.
  #5  
Old Dec 9, 2016, 12:50 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
@poorboy and/or @CrouchingBruin:
Can you do an export of yout Montezuma settings and attach them to a reply. I haven't been able to cause the issue yet.

NEVER MIND now I have it occurring
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Dec 9, 2016 at 12:53 PM.
  #6  
Old Dec 9, 2016, 01:24 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
see Patch 128-02: Fix issue where thumbnails don't link to post after upgrading to WP 4.7 for the solution
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Dec 9, 2016 at 05:18 PM.
  #7  
Old Dec 9, 2016, 01:53 PM
poorboy
 
3 posts · Dec 2016
Quote:
Originally Posted by juggledad
or replace the current montezuma/includes/thumb.php with the attached version - after unzipping it
Works, thanks <3
  #8  
Old Dec 11, 2016, 12:48 AM
CrouchingBruin's Avatar
CrouchingBruin
 
299 posts · Aug 2010
Santa Monica, CA
Yes, works for me, too. Thanks!
__________________
My Montezuma-themed sites: ESHS Girls Basketball Team, Venice Hongwanji Buddhist Temple
Please consider making a donation to BytesForAll for their great themes!

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically linking posts to menu pages? roxybc Page & Category Menu Bars 1 Sep 14, 2014 05:40 PM
Post Thumbnails both on excerpts and full posts? untore Excerpts, Read more, Pagination 3 Feb 4, 2013 12:28 PM
Post thumbnails (in excerpts) not linking to full post Fux Excerpts, Read more, Pagination 5 Jan 5, 2011 07:16 AM
BFA Popular Posts widget linking to the same permalink over and over daniel3ub Sidebars & Widgets 3 Mar 23, 2010 05:40 AM
linking comments from different posts? WesleyTack Comments, trackbacks & pings 1 Dec 28, 2009 12:12 PM


All times are GMT -6. The time now is 12:21 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.