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 » Atahualpa 3 Wordpress theme » New Versions, & Updating » Old Version fixes and change logs »

BUGFIX 364-08: Using the 'Display Avatar' plugin causes two copies of the avatar


  #1  
Old Apr 26, 2011, 06:35 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
================================================== ====
NOTE: This fix has been superceeded by BUGFIX 364-09: Page/Post titles show double after installing BUGFIX 364-08
================================================== ====


Using the 'Display Avatar' plugin will result in two copies of the avatar to be displayed on multi post pages. This is caused because the plugin hooks into the WordPress function 'the_title()' and the Atahualpa code that builds the post titles calls the function multiple times.

This fix changes the Atahualpa code so it only calls the function once thus removing the issue of duplicate avatars from appearing.

to Fix this issue, edit bfa_post_parts and change lines 30-68 (version 3.6.4) from
HTML Code:
function bfa_post_headline($before = '<div class="post-headline">', $after = '</div>') 
{
	global $bfa_ata, $post;

	if ( is_single() OR is_page() ) {
		$bfa_ata_body_title = get_post_meta($post->ID, 'bfa_ata_body_title', true);
		$bfa_ata_display_body_title = get_post_meta($post->ID, 'bfa_ata_display_body_title', true);
		$bfa_ata_body_title_multi = get_post_meta($post->ID, 'bfa_ata_body_title_multi', true);
	} else {
		$bfa_ata_body_title_multi = get_post_meta($post->ID, 'bfa_ata_body_title_multi', true);
	}
	
	// Since 3.6.1: Display a link to the full post if there is no post title and the post is too short
	// for a read more link.
	if ( get_the_title() == '' ) { ?>
		<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link">Permalink</a><?php 
		
	} else if ( (!is_single() AND !is_page()) OR $bfa_ata_display_body_title == '' ) {
		
		echo $before; ?>
		<h<?php echo $bfa_ata['h_posttitle']; ?>><?php 
			
		if( !is_single() AND !is_page() ) { ?>
			<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php 
		} 

		if ( (is_single() OR is_page()) AND $bfa_ata_body_title != "" ) {
			echo htmlentities($bfa_ata_body_title,ENT_QUOTES,'UTF-8');
		} else {
			if ( $bfa_ata_body_title_multi != '' ) 
				echo htmlentities($bfa_ata_body_title_multi,ENT_QUOTES,'UTF-8');  
			else 
				the_title(); 
		}

		if ( !is_single() AND !is_page() ) { ?></a><?php } ?></h<?php echo $bfa_ata['h_posttitle']; ?>>
		<?php echo $after;
	}
}
to
HTML Code:
function bfa_post_headline($before = '<div class="post-headline">', $after = '</div>') 
{
	global $bfa_ata, $post;

	if ( is_single() OR is_page() ) {
		$bfa_ata_body_title = get_post_meta($post->ID, 'bfa_ata_body_title', true);
		$bfa_ata_display_body_title = get_post_meta($post->ID, 'bfa_ata_display_body_title', true);
		$bfa_ata_body_title_multi = get_post_meta($post->ID, 'bfa_ata_body_title_multi', true);
	} else {
		$bfa_ata_body_title_multi = get_post_meta($post->ID, 'bfa_ata_body_title_multi', true);
	}
	
	// Since 3.6.1: Display a link to the full post if there is no post title and the post is too short
	// for a read more link.
	
	// some plugins hook into 'the_title()' so we only want it called once. But it must aslo be called 
	// when using the bfa_ata titles so we use a dummy call ($bfa_toss = the_title();) in those cases
	$bfa_temp_title = get_the_title();
	if ( $bfa_temp_title == '' ) { ?>
		<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link">Permalink</a><?php 
		
	} else if ( (!is_single() AND !is_page()) OR $bfa_ata_display_body_title == '' ) {
		
		echo $before; ?>
		<h<?php echo $bfa_ata['h_posttitle']; ?>><?php 
			
		if( !is_single() AND !is_page() ) { ?>
			<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php $bfa_temp_title ?>"><?php 
		} 

		if ( (is_single() OR is_page()) AND $bfa_ata_body_title != "" ) {
			echo htmlentities($bfa_ata_body_title,ENT_QUOTES,'UTF-8');
			$bfa_toss = the_title();
		} else {
			if ( $bfa_ata_body_title_multi != '' ) {
				echo htmlentities($bfa_ata_body_title_multi,ENT_QUOTES,'UTF-8');  
			$bfa_toss = the_title(); }
			else 
				echo $bfa_temp_title; 
		}

		if ( !is_single() AND !is_page() ) { ?></a><?php } ?></h<?php echo $bfa_ata['h_posttitle']; ?>>
		<?php echo $after;
	}
}
or you can use the following attachment which has the correction already made.
bfa_post_parts.php.zip
__________________
"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; May 17, 2011 at 10:57 AM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Display Avatar plugin not work fine with Atahualpa theme gtrufero Plugins & Atahualpa 11 Apr 26, 2011 06:40 AM
Help please with Styling Avatar Stevieboy Center area post/pages 9 Nov 22, 2010 03:29 PM
Theme code conflicting with avatar plugin? wadams92101 Plugins & Atahualpa 5 Jul 27, 2010 10:40 AM
How to change the default Avatar whatsmytruth Comments, trackbacks & pings 5 May 14, 2009 07:39 PM
Avatar in Post using Avatar Plug-in DMO Atahualpa 3 Wordpress theme 1 Mar 23, 2009 09:43 PM


All times are GMT -6. The time now is 10:45 PM.


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