Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Atahualpa 3.4.2 bug - html entities instead of UTF8 chars in meta fields


  #1  
Old Aug 4, 2009, 06:31 AM
pgc
 
25 posts · May 2009
Warsaw
Hello,
When using SEO features of v. 3.4.2 the html entities apperars in the page meta fields instead of UTF 8 chars. Attached picture shows the problem. I used Polish language and Polish chars. I guess the same might happent with German Umlauts.
Is it a bug? Maybe there is a workaround (I know one of them - use one of SEO plugins - I rather want to stay with atahualpa's SEO options).
Best regards
Piotr
Attached Thumbnails
Click image for larger version

Name:	Meta_fields.jpg
Views:	605
Size:	171.3 KB
ID:	215  
  #2  
Old Aug 8, 2009, 06:35 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Upload this as functions/bfa_meta_tags.php (and rename the existing bfa_meta_tags.php to bfa_meta_tags.php-OLD or so before) and see if that works

PHP Code:
<?php

/* check to see if any of these SEO plugins is installed.
   If yes, the Bytes For All SEO options will be deactivated,
   no matter what the option "Use Bytes For All SEO options?" is set to. */

// if "All-In-One_SEO" Plugin (http://semperfiwebdesign.com) is installed
if(class_exists('All_in_One_SEO_Pack') OR

// if "WpSEO" Plugin (http://www.wpseo.de/) is installed
class_exists('wpSEO') OR

// if "HeadSpace2" Plugin (http://urbangiraffe.com/plugins/headspace2/) is installed
class_exists('HeadSpace2_Admin') OR

// if "SEO Title Tag" Plugin (http://www.netconcepts.com/seo-title-tag-plugin/) is installed
function_exists('seo_title_tag_options_page') OR

/* if "Another WordPress Meta Plugin"
   (http://wp.uberdose.com/2006/11/04/another-wordpress-meta-plugin/) is installed */
class_exists('Another_WordPress_Meta_Plugin') OR

// if "Platinum_SEO_Pack" Plugin (http://techblissonline.com/platinum-seo-pack/) is installed
class_exists('Platinum_SEO_Pack') OR

/* if "HeadMeta" Plugin is installed
   (http://dougal.gunters.org/blog/2004/06/17/my-first-wordpress-plugin-headmeta) */
function_exists('headmeta') OR

/* if "Improved Meta Description Snippets" Plugin is installed
  (http://www.microkid.net/wordpress-plugins/improved-meta-description-snippets/) */
function_exists('bas_improved_meta_descriptions') OR

// if "Head META Description" Plugin (http://guff.szub.net/head-meta-description/) is installed
function_exists('head_meta_desc') OR

// if "Robots Meta" Plugin (http://yoast.com/wordpress/robots-meta/) is installed
class_exists('RobotsMeta_Admin') OR

// if "Quick META Keywords" Plugin (http://www.quickonlinetips.com/) is installed
function_exists('quickkeywords') OR

// if "Add Your Own Headers" Plugin (http://wp.uberdose.com/2007/03/30/add-your-own-headers/) is installed
class_exists('Add_Your_Own_Headers') OR

// if "SEO_Wordpress" Plugin (http://www.utheguru.com/seo_wordpress-wordpress-seo-plugin) is installed
function_exists('SEO_wordpress') OR

// if the option "Use Bytes For All SEO options?" is set to "No"
$bfa_ata['use_bfa_seo'] == "No")

{
?>
<title><?php wp_title('&laquo;'true'right'); ?><?php bloginfo('name'); ?></title>
<?php
} else { ?><title><?php

if ( is_home() ) {

    
bloginfo('name');

} else {

    if ( 
is_single() OR is_page() ) {
        
// post and page titles get their own filter from WP
        
$bfa_meta_title get_post_meta($post->ID'bfa_ata_meta_title'true);
        if ( 
$bfa_meta_title != '' ) {
            
#$bfa_ata_page_title = $bfa_meta_title; 
            
$bfa_ata_page_title htmlentities($bfa_meta_title,ENT_QUOTES,'UTF-8');
        } else {
            
$bfa_ata_page_title htmlentities(single_post_title(''false),ENT_QUOTES,'UTF-8');
        }
        
    } elseif ( 
is_category() ) {
        
// cat titles don't get a filter, so htmlentities is required
        
$bfa_ata_page_title htmlentities(single_cat_title(''false),ENT_QUOTES,'UTF-8');

    } elseif ( 
function_exists('is_tag') AND is_tag() ) {
        
// tag titles get their own filter from WP
        
$bfa_ata_page_title htmlentities(single_tag_title(''false),ENT_QUOTES,'UTF-8');

    } elseif ( 
is_search() ) {
        
// no WP filter, htmlentities required
        
$bfa_ata_page_title htmlentities(wp_specialchars($s),ENT_QUOTES,'UTF-8');

    } elseif ( 
is_day() ) {
        
$bfa_ata_page_title htmlentities(get_the_time(__('l, F jS, Y','atahualpa')),ENT_QUOTES,'UTF-8');

    } elseif ( 
is_month() ) {
        
$bfa_ata_page_title htmlentities(get_the_time(__('F Y','atahualpa')),ENT_QUOTES,'UTF-8');

    } elseif ( 
is_year() ) {
        
$bfa_ata_page_title htmlentities(get_the_time('Y'),ENT_QUOTES,'UTF-8');
    }
#    elseif ( is_author() ) { 
#        $bfa_ata_page_title = htmlentities(the_author(),ENT_QUOTES); }   // this won't work

    
elseif ( is_404() ) { 
        
$bfa_ata_page_title __('404 - Page not found','atahualpa');

    } else {
        
$bfa_ata_page_title htmlentities(wp_title(''false),ENT_QUOTES,'UTF-8');

    }

    switch ( 
$bfa_ata['title_separator_code'] ) {
        case 
1$bfa_ata_title_separator "  "; break;
        case 
2$bfa_ata_title_separator "  "; break;
        case 
3$bfa_ata_title_separator " : "; break;
        case 
4$bfa_ata_title_separator ": "; break;
        case 
5$bfa_ata_title_separator " > "; break;
        case 
6$bfa_ata_title_separator " < "; break;
        case 
7$bfa_ata_title_separator " - "; break;
        case 
8$bfa_ata_title_separator "  "; break;
        case 
9$bfa_ata_title_separator "  "; break;
        case 
10$bfa_ata_title_separator "  "; break;
        case 
11$bfa_ata_title_separator "  "; break;
        case 
12$bfa_ata_title_separator "  "; break;
        case 
13$bfa_ata_title_separator " | "
    }

    
/* 3 different styles for meta title tag: (1) Blog Title - Page Title,
       (2) Page Title - Blog Title, (3) Page Title */

    
if ( $bfa_ata['add_blogtitle'] == "Blog Title - Page Title" ) {
         
bloginfo('name'); echo $bfa_ata_title_separator $bfa_ata_page_title;

    } elseif ( 
$bfa_ata['add_blogtitle'] == "Page Title - Blog Title" ) {
         echo 
$bfa_ata_page_title $bfa_ata_title_separatorbloginfo('name');

    } elseif ( 
$bfa_ata['add_blogtitle'] == "Page Title" ) {
       echo 
$bfa_ata_page_title;

    }

}

?></title>
<?php 

// META DESCRIPTION & KEYWORDS for (only) the HOMEPAGE.
if ( function_exists('is_front_page') ? is_front_page() : is_home() ) {
#if ( is_home() ) {
     
if ( trim($bfa_ata['homepage_meta_description'] ) != "" ) {
        echo 
"<meta name=\"description\" content=\"" .
        
htmlentities($bfa_ata['homepage_meta_description'],ENT_QUOTES,'UTF-8') . "\" />\n";
    }
    if ( 
trim($bfa_ata['homepage_meta_keywords'] ) != "" ) {
        echo 
"<meta name=\"keywords\" content=\"" .
        
htmlentities($bfa_ata['homepage_meta_keywords'],ENT_QUOTES,'UTF-8') . "\" />\n";
    }
}

// META DESCRIPTION & KEYWORDS Tag for single post pages and static pages:
if ( is_single() OR is_page() ) {
    
$bfa_meta_description get_post_meta($post->ID'bfa_ata_meta_description'true);
    
$bfa_meta_keywords get_post_meta($post->ID'bfa_ata_meta_keywords'true);
    if ( 
$bfa_meta_description != '' ) {
        echo 
"<meta name=\"description\" content=\"" .
        
htmlentities($bfa_meta_description,ENT_QUOTES,'UTF-8') . "\" />\n";
    }
    if ( 
$bfa_meta_keywords != '' ) {
        echo 
"<meta name=\"keywords\" content=\"" .
        
htmlentities($bfa_meta_keywords,ENT_QUOTES,'UTF-8') . "\" />\n";
    }  
}

// META DESCRIPTION Tag for CATEGORY PAGES, if a category description exists:
if ( is_category() AND strip_tags(trim(category_description())) != "" ) {
    
/* the category description gets its own ASCII code filter from WP,
       but <p> ... </p> tags will be included by WP, so we remove them here: */
    
echo "<meta name=\"description\" content=\"" .
    
htmlentities(strip_tags(trim(category_description())),ENT_QUOTES,'UTF-8') . "\" />\n";
}


/* prevent duplicate content by making archive pages noindex:
   If it's a date, category or tag page: */
if ( ($bfa_ata['archive_noindex'] == "Yes" AND is_date()) OR 
(
$bfa_ata['cat_noindex'] == "Yes" AND is_category()) OR 
(
$bfa_ata['tag_noindex'] == "Yes" AND is_tag()) ) {
    echo 
'<meta name="robots" content="noindex, follow" />'."\n";
}
}


?>
  #3  
Old Aug 10, 2009, 07:44 AM
pgc
 
25 posts · May 2009
Warsaw
Hello,

It is almost OK - the letter "" is translated to &oacute;.

I tried other solution - I removed "htmlentities" function call and just put raw strings as below. Is it OK or not?
regards
Piotr

[...]

// META DESCRIPTION & KEYWORDS for (only) the HOMEPAGE.
if ( function_exists('is_front_page') ? is_front_page() : is_home() ) {
#if ( is_home() ) {
if ( trim($bfa_ata['homepage_meta_description'] ) != "" ) {
echo "<meta name=\"description\" content=\"" .
# htmlentities($bfa_ata['homepage_meta_description'],ENT_QUOTES) . "\" />\n";
$bfa_ata['homepage_meta_description'] . "\" />\n";
}
if ( trim($bfa_ata['homepage_meta_keywords'] ) != "" ) {
echo "<meta name=\"keywords\" content=\"" .
# htmlentities($bfa_ata['homepage_meta_keywords'],ENT_QUOTES) . "\" />\n";
$bfa_ata['homepage_meta_keywords'] . "\" />\n";
}
}

// META DESCRIPTION & KEYWORDS Tag for single post pages and static pages:
if ( is_single() OR is_page() ) {
$bfa_meta_description = get_post_meta($post->ID, 'bfa_ata_meta_description', true);
$bfa_meta_keywords = get_post_meta($post->ID, 'bfa_ata_meta_keywords', true);
if ( $bfa_meta_description != '' ) {
echo "<meta name=\"description\" content=\"" .
# htmlentities($bfa_meta_description,ENT_QUOTES) . "\" />\n";
$bfa_meta_description . "\" />\n";
}
if ( $bfa_meta_keywords != '' ) {
echo "<meta name=\"keywords\" content=\"" .
# htmlentities($bfa_meta_keywords,ENT_QUOTES) . "\" />\n";
$bfa_meta_keywords . "\" />\n";
}
}

// META DESCRIPTION Tag for CATEGORY PAGES, if a category description exists:
if ( is_category() AND strip_tags(trim(category_description())) != "" ) {
/* the category description gets its own ASCII code filter from WP,
but <p> ... </p> tags will be included by WP, so we remove them here: */
echo "<meta name=\"description\" content=\"" .
strip_tags(trim(category_description())) . "\" />\n";
}
  #4  
Old Aug 11, 2009, 02:58 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
What letters did not work after the change suggested by me, and does it work now with your version?
  #5  
Old Aug 11, 2009, 07:03 AM
pgc
 
25 posts · May 2009
Warsaw
There is only one letter translated to entity (both in upper and lower case) as follows:
"" -> &oacute;
"" -> &Oacute;
Best regards
Piotr
  #6  
Old Aug 13, 2009, 10:14 AM
drleo66
 
3 posts · Jul 2009
I have a same char-set problem,
new php file is work but () is already (&uuml How can i solve this problem
thank you

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
why Fields in the Atahualpa 3.3.3 does not expand? css inserts, html inserts krystyna New Versions, & Updating 3 Oct 28, 2010 01:22 PM
SEO options spoil my meta tag chars encoding PetrosPolonos Atahualpa 3 Wordpress theme 5 Aug 14, 2009 06:22 AM
[SOLVED] Format Date for Custom fields using %meta(fieldname)% grasshopper Post-Kicker, -Byline & -Footer 4 Aug 1, 2009 09:01 AM
[SOLVED] Problems with HTML in Page Title fields ins 3.4.2 bcorrigan New Versions, & Updating 2 Jul 16, 2009 10:06 AM
[SOLVED] why Fields in the Atahualpa 3.3.3 does not expand? css inserts, html inserts ppat2 New Versions, & Updating 3 Jun 2, 2009 06:41 PM


All times are GMT -6. The time now is 02:07 PM.


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