Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Old Version fixes and change logs (http://forum.bytesforall.com/forumdisplay.php?f=37)
-   -   PATCH 367-02: Page Titles are double with 3.6.7 (now part of PATCH 367-04) (http://forum.bytesforall.com/showthread.php?t=14155)

juggledad May 13, 2011 03:57 PM

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;
    }
}



All times are GMT -6. The time now is 10:52 AM.

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