Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » New Versions, & Updating » Old Version fixes and change logs »

PATCH 367-02: Page Titles are double with 3.6.7 (now part of PATCH 367-04)


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old May 13, 2011, 03:57 PM
juggledad's Avatar
juggledad
 
21,714 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
PATCH 367-02: Page Titles are double with 3.6.7 (now part of PATCH 367-04)

If you use this fix, think about donating to me, I've spent time figuring this issue out and coming up with the fix. Sending me a donation will encourage me to continue to support Atahualpa. You can use the 'Donate to Juggledad' button on the donate page

This fix is incorporated in PATCH 367-04

This fix is for Atahualpa version 3.6.7
===========================
DESCRIPTION: In some cases, page titles will show up twice and if the 'Body Title Single Pages' is different than the 'Page Title', it will show first. (In other words duplicate post titles)

CAUSE: This is caused by the addition of the fix for "PATCH 364-08: Using the 'Display Avatar' plugin causes two copies of the avatar" being added to the code. This would show up if the 'Body Title Single Pages' option had a value regardless of the Atahualpa option 'Use Post / Page Options?'.

FIX: This fix corrects this error and in addition fixes a long standing error that caused the 'Body Title Single Pages' to be used when the 'Use Post / Page Options?' was set to 'No'.

To fix this issue,
1) Download the attached file.
2) unzip it on your computer
3) FTP it to the 'atahualpa/functions' folder on your host, replacing the copy that is there.

This fix is incorporated in PATCH 367-04

--------------------------------------------------------------
The following is the change that was made to the code:
--------------------------------------------------------------
bfa_post_parts.php lines 30-74 were changed 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.
    
    // 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;
    }
}
to
HTML Code:
function bfa_post_headline($before = '<div class="post-headline">', $after = '</div>') 
{
    global $bfa_ata, $post;

//  Case 1 - 'Use Post / Page Options' is no, then just use the post/page title
    if ($bfa_ata['page_post_options'] == 'No') {
        echo $before; 
        ?><h<?php echo $bfa_ata['h_posttitle']; ?>><?php 
            if ( is_single() OR is_page() ) {
                the_title(); ?></h<?php echo $bfa_ata['h_posttitle']; ?>><?php
            } else { ?>
                <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title() ?>">
                <?php the_title(); ?></a></h<?php echo $bfa_ata['h_posttitle']; ?>><?php
            }
        echo $after;
        return;
    }
//  Case 2 - 'Use Post / Page Options' is Yes, then use the BFA title
    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('','',$FALSE); 
    // 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 
        
    } elseif ( (!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('','',false);
        } else {
            if ( $bfa_ata_body_title_multi != '' ) {
                echo htmlentities($bfa_ata_body_title_multi,ENT_QUOTES,'UTF-8');  
                $bfa_toss = the_title('','',false);
            } else 
                echo $bfa_temp_title; 
        }

        if ( !is_single() AND !is_page() ) { ?></a><?php } ?></h<?php echo $bfa_ata['h_posttitle']; ?>>
        <?php echo $after;
    }
}
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support

Last edited by juggledad; Jul 8, 2011 at 09:42 AM.

Bookmarks

Tags
ata 3.6.7, page titles

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PATCH 367-05: Site Title appended after the 'WordPress SEO by Yoast' title juggledad Old Version fixes and change logs 0 Jul 4, 2011 05:24 AM
PATCH 367-04: Hovering over a Post/Page title only shows "Permanent Link to " juggledad Old Version fixes and change logs 0 Jun 20, 2011 12:03 PM
PATCH 367-03: PHP errors when adding widget areas in index.php juggledad Old Version fixes and change logs 0 May 14, 2011 09:52 AM
PATCH 367-01: Odd effects when 'CSS: Compress' = 'Yes' juggledad Old Version fixes and change logs 0 May 13, 2011 05:52 AM
BUG in 3.3.1 - Please update to 3.3.2 or apply this patch Flynn New Versions, & Updating 7 Apr 4, 2009 04:31 PM


All times are GMT -6. The time now is 03:19 PM.


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