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 » eCommerce & Atahualpa »

Changing product page titles - not sure how to do it.


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 Jan 20, 2010, 02:59 PM
tobywinn
 
15 posts · Jun 2009
HAPPY TO PAY DONATION IF YOU CAN HELP!

Hi

Thanks for a great theme. On my site - http://www.amberpumpkin.com I have used the wp-ecommerce plugin and all is going well - I am getting people buying!!!

It was recommended changing the header.php so the product title is the page title rather than products pages.

Please see below the instructions I am following. When I try and change what they say I cant find it.

The file to take a look at is actually in your theme's folder. Login using your ftp client to and then navigate to:
wp_content/themes/yourtheme/header.php
(where 'yourtheme' is the name of the theme that you are using).
Open this file for editing and the find the line that reads something like:
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
We want to replace this code, primarily to help Wordpress pick up the title of your actual product for the browser title (important for SEO), rather than the default which is to simply call it 'products' or something similar.
No doubt this will eventually become part of the standard plugin at some stage – but we give full and unequivocal credit to Dave at Dew Point Product ions for this nice piece of code (you should visit the site and hook up with them for some SEO work to make sure you are ranking highly for your desired keywords!)
So – the code to replace is now found – here is the code to put there instead:

<title><?php
function oGetProductName( $meta ){
global $table_prefix;
$query = "SELECT product_id
FROM ".$table_prefix."wpsc_productmeta
WHERE meta_value = '".$meta."'";
$result = mysql_query( $query );
$row = mysql_fetch_array( $result );
$productid = $row[0];
$query = "SELECT name
FROM ".$table_prefix."product_list
WHERE id = ".$productid;
$result = mysql_query( $query );
$row = mysql_fetch_array( $result );
$productname = $row[0];
return $productname;
}
function oGetCategoryName( $nicename ){
global $table_prefix;
$query = "SELECT name
FROM ".$table_prefix."product_categories
WHERE `nice-name` = '".$nicename."'";
$result = mysql_query( $query );
$row = mysql_fetch_array( $result );
[RETURN TO CONTENTS] ©STasticDesigns.
$categoryname = $row[0];
return $categoryname;
}
if( is_page() && trim(wp_title ('',false )) == 'Products Page' ){
$pparts = explode('/', trim($_SERVER['REQUEST_URI'],'/') );
if( $pparts[2] != '' ){
echo oGetProductName( $pparts[2] );
}
else if( $pparts[1] != '' ){
echo oGetCategoryName( $pparts[1] );
}
else{
wp_title (''); echo ' at Your Site Name';
}
}
else{ if ( is_single() ){ wp_title(''); }elseif (is_404()){ echo 'Your Site Name - 404 Error';
}elseif (is_category()) { echo single_cat_title(); echo ' at Your Site Name'; }elseif
(is_page()) {
wp_title (''); echo ' at Welsh Farm Organics'; }else{ echo 'Your Site Name'; }
}
?></title>
Essentially what this does is grab the title of your product and use that by being clever with the SQL that is being used by the WP-Ecommerce plugin.

The result is much nicer URLs which are far more likely to help your SEO efforts.
Now go and check your site. You should see absolutely no differences to your existing URLs at all as this only affects the WP-Ecommerce URLs.


Thanks

Toby

Last edited by tobywinn; Jan 25, 2010 at 01:48 PM. Reason: need a reply so paying donation!
  #2  
Old Feb 2, 2010, 07:39 AM
Gavnav
 
2 posts · Feb 2010
Dear tobywinn

I seem to be in the same boat as you.

I have searched the web on how to make WP E-commerce SEO friendly and also came across the two post (one from dewpointproductions and one other). I did not see you post when I posted the same question....

Anyway, I am a newbie and cannot find the relevant Header.php file section.

As it appears to be a theme issue and not a WP e-commerce problem (or vice versa - as WP e-commerce uses H1 tags instead of H2 or something).

I have posted my post here: http://forum.bytesforall.com/showthread.php?t=5640

I have had lots of views, no replies.

Let's hold thumbs for an answer and solution.

Regards
Gavin
  #3  
Old Feb 2, 2010, 12:43 PM
juggledad's Avatar
juggledad
 
21,937 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
the <title> code is in bfa_meta_tags.php
__________________
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
  #4  
Old Feb 4, 2010, 03:42 PM
tobywinn
 
15 posts · Jun 2009
Appreciate your help but I changed it and nothing happened.

Very happy to make a donation if you can help make it work.

Regards


Toby
  #5  
Old Feb 5, 2010, 03:20 PM
juggledad's Avatar
juggledad
 
21,937 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
What exactly did you change?
__________________
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
  #6  
Old Feb 9, 2010, 03:02 PM
tobywinn
 
15 posts · Jun 2009
Sorry for delay - I changed:

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

For the code in the thread above.


Thanks

Bookmarks

Tags
e-commerce, header php, page titles, seo, wp-ecommerce

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ThemeFrame as a Service instead of a Product? Flynn ThemeFrame Presales 7 Nov 21, 2009 05:22 PM
Changing Color and Font for Post titles daisy24 Atahualpa 3 Wordpress theme 2 Nov 17, 2009 01:40 PM
Changing Post and Page titles to h1 tags RickHart Atahualpa 3 Wordpress theme 2 Sep 17, 2009 06:51 PM
RSS Feeds: Changing Titles and Descriptions anonuser RSS, Feeds & Subscribing 3 Aug 23, 2009 09:03 PM
Changing Font in Pg Menu & Pg Titles ofpeb Page & Category Menu Bars 1 Apr 23, 2009 09:30 PM


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


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