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 » Header configuration & styling »

Pls help me change this code<title><?php bloginfo('name'); ?><?php wp_title(); ?></ti


 
Prev Previous Post   Next Post Next
  #1  
Old Jan 25, 2010, 01:48 PM
tobywinn
 
15 posts · Jun 2009
Smile Pls help me change this code<title><?php bloginfo('name'); ?><?php wp_title(); ?></ti

I have an eccommerce site - http://www.amberpumpkin.com - it has lots of products but they all have the same page titles.

I need to replace it with the code below - then it will take the product name and put it in the title - great for SEO.

I can't find the bit of code to change.

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

Bookmarks

Tags
ecommerce, header, page title, pho, title

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP modifying the underlying code markelshark Atahualpa 3 Wordpress theme 1 Nov 17, 2009 02:41 PM
How to insert php code into Byline JakeThePeg Post-Kicker, -Byline & -Footer 1 Aug 27, 2009 06:16 PM
placing favicon code into header.php AlbaSurf Header configuration & styling 1 Aug 26, 2009 08:55 PM
[SOLVED] No sidebar.php...where do I put the code? d_random Atahualpa 3 Wordpress theme 0 Apr 3, 2009 12:42 PM
Location for php code for SOCIABLE widget? strangelove Post-Kicker, -Byline & -Footer 1 Feb 18, 2009 06:04 PM


All times are GMT -6. The time now is 05:31 PM.


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