Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Problems
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 26th, 2012, 05:51 AM
wildstyles wildstyles is offline
 
Join Date: Feb 2012
Posts: 21
Default Title gets overwritten by Yoast Wordpress SEO plugin

Store ID: 36187
Website URL: www.thewildstyles.com
URL to page in question: http://www.thewildstyles.com/store/m...1400002531543/ (or any other product)

Hi,

I have always used this code in the <head elements> of my product pages:
<title>[product.name] - [category.name] - Store</title>

And it used to work fine, but recently since an updated version of Wordpress Yoast SEO, the plug in just overwrites the product title with whatever setting I enter in the Yoast plugin section under Page - Title. So it always shows "Store" (the page title).

Is there any way to remove that title when on DFR pages?
A while ago I was having another Yoast plug in bug, resulting in 2 canonical urls, and you solved that by having me add this code to functions.php:
function dfr_remove_wpseo_canonical( $canonical ) {
if (is_dfr()) {
$canonical = false;
}
return $canonical;
}
add_filter( 'wpseo_canonical', 'dfr_remove_wpseo_canonical' );

Maybe there's a similiar solution for the page title when in the store pages?

Thanks in advance, your support is always quick and reliable.

Ivar.
  #2  
Old September 26th, 2012, 06:58 AM
wildstyles wildstyles is offline
 
Join Date: Feb 2012
Posts: 21
Default

hi, I temporarily fixed the issue by installing an older version of the Yoast plug in, but I would still love to see if you have a more permanent fix.

Thanks in advance,
Ivar.
  #3  
Old September 26th, 2012, 08:43 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

I haven't tested it but this should work:

PHP Code:
function dfr_remove_wpseo_title$title ) {
    global 
$wpseo_front;
    if (
is_dfr()) {
        
remove_filter('wp_title', array($wpseo_front'title'), 15);
    }
}
add_action'init''dfr_remove_wpseo_title' ); 
Eric
  #4  
Old September 26th, 2012, 09:03 AM
wildstyles wildstyles is offline
 
Join Date: Feb 2012
Posts: 21
Default

Hi Eric,

That piece of code made the whole store malfunction.
I would just get an 'cannot find site' error...
  #5  
Old September 26th, 2012, 09:31 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Sorry, that code was wrong. It was a little trickier than I thought. I've tested this code and it is working for me:

PHP Code:
function dfr_remove_wpseo_title$title ) {
    global 
$wpseo_front;
    if (
is_dfr()) {
        
remove_filter('wp_title', array($wpseo_front'title'), 15);
    }
}
add_action'init''dfr_remove_wpseo_title' ); 
This code removes the title filter for the Yoast WordPress SEO plugin only on Datafeedr store pages.

Place this code in your theme's functions.php file.

I've also updated my previous post with the correct code to prevent confusion.

Eric
  #6  
Old September 26th, 2012, 09:55 AM
wildstyles wildstyles is offline
 
Join Date: Feb 2012
Posts: 21
Default

no problem at all.

this code worked perfecty!

thanks again!!
  #7  
Old September 27th, 2012, 02:31 AM
wepisto wepisto is offline
 
Join Date: Jul 2012
Posts: 44
Default

Hi

Must i replace this code for a other code or can i put the code at the bottom of the (functions.php) file.

Thanks
  #8  
Old September 27th, 2012, 08:26 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

I'm not sure what other code you are referring to but you should just be able to add the code to the bottom of your functions.php file.

Eric
  #9  
Old March 23rd, 2014, 05:07 AM
theglassicon theglassicon is offline
 
Join Date: Jan 2014
Posts: 6
Default

Hello,

Is there any way to overide og:title that wordpress seo plugin uses?

Uses the same title for all store pages.

thanx.
  #10  
Old March 23rd, 2014, 05:29 AM
theglassicon theglassicon is offline
 
Join Date: Jan 2014
Posts: 6
Default

I can overide plugins title with this filter,

function my_opengraph_title( $title ) {
return $title;
}
add_filter( 'wpseo_opengraph_title', 'my_opengraph_title' );

but i dont know how to access product's title variable to change title with the dfr title.
  #11  
Old March 23rd, 2014, 09:58 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

Try this code:

PHP Code:
add_filter'wpseo_opengraph_title''my_opengraph_title' );
function 
my_opengraph_title$title ) {
    if (
is_dfr()) { 
        
$title $GLOBALS['DFR_PLUGIN']->shop_content->title;
    }
    return 
$title;

Eric
  #12  
Old March 23rd, 2014, 10:54 AM
theglassicon theglassicon is offline
 
Join Date: Jan 2014
Posts: 6
Default

Thank you!
  #13  
Old May 5th, 2014, 02:34 PM
benjaffer benjaffer is offline
 
Join Date: Feb 2014
Posts: 118
Default

Quote:
Originally Posted by Eric View Post

PHP Code:
function dfr_remove_wpseo_title$title ) {
    global 
$wpseo_front;
    if (
is_dfr()) {
        
remove_filter('wp_title', array($wpseo_front'title'), 15);
    }
}
add_action'init''dfr_remove_wpseo_title' ); 
This code removes the title filter for the Yoast WordPress SEO plugin only on Datafeedr store pages.

Place this code in your theme's functions.php file.

I've also updated my previous post with the correct code to prevent confusion.

Eric

Hi Eric

I tried this code in my functions.php but something strange is happened! see attached photos.

Photo 1 is my application of the code in my theme's functions.php;

Photo 2 (backend) is what happens when I update the functions.php file and it stays there;

Photo 3 (frontend) is what happens to my site after updating the functions.php file and it stays there.

What's wrong?
Attached Thumbnails
Click image for larger version

Name:	snippet.png
Views:	124
Size:	35.5 KB
ID:	702  Click image for larger version

Name:	functions.php file update.png
Views:	115
Size:	43.6 KB
ID:	703  Click image for larger version

Name:	frontend.png
Views:	112
Size:	34.8 KB
ID:	704  
  #14  
Old May 5th, 2014, 03:39 PM
stefan stefan is offline
 
Join Date: Feb 2008
Posts: 5,901
Default

Move the ?> to the bottom of your file.
  #15  
Old May 5th, 2014, 03:53 PM
benjaffer benjaffer is offline
 
Join Date: Feb 2014
Posts: 118
Default

Perfect. Still new though :$
  #16  
Old June 4th, 2014, 05:31 AM
kidnkaboodle kidnkaboodle is offline
 
Join Date: Mar 2014
Posts: 3
Default

Hi,

I too have problems with both the canonical tag and title tag issues. I've added recommended code to functions.php file from this additional post:

http://www.datafeedr.com/forums/showthread.php?t=8262

but still no joy. As it stands no product pages are getting indexed at all

knk_functions.txt


Store ID: 44639
Website URL: http://www.kidnkaboodle.com.au/
URL to page in question: http://www.kidnkaboodle.com.au/store/category/bedtime/
  #17  
Old June 4th, 2014, 06:16 AM
stefan stefan is offline
 
Join Date: Feb 2008
Posts: 5,901
Default

Looks like you put the code in comments in the functions.php.

Can you remove /** and */ from

PHP Code:
//Set Default permalink on theme activation: end
/**
function dfr_remove_wpseo_canonical( $canonical ) {
    if (is_dfr()) {
        $canonical = false;
    }
    return $canonical;
}
add_filter( 'wpseo_canonical', 'dfr_remove_wpseo_canonical' );


function dfr_remove_wpseo_title( $title ) {
    global $wpseo_front;
    if (is_dfr()) {
        remove_filter('wp_title', array($wpseo_front, 'title'), 15, 3 );
    }
}
add_action( 'init', 'dfr_remove_wpseo_title' ); 


add_filter( 'wpseo_opengraph_title', 'my_opengraph_title' );
function my_opengraph_title( $title ) {
    if (is_dfr()) { 
        $title = $GLOBALS['DFR_PLUGIN']->shop_content->title;
    }
    return $title;
}  
*/
?> 
Then save the file and upload again.
  #18  
Old June 5th, 2014, 02:28 AM
kidnkaboodle kidnkaboodle is offline
 
Join Date: Mar 2014
Posts: 3
Default

thanks - my bad. I updated the code and the canonical tag has since disappeared and title tag has the store removed i.e.[ category page | ] (see attached)

http://www.kidnkaboodle.com.au/store/category/bedtime/
Attached Thumbnails
Click image for larger version

Name:	knk_title.PNG
Views:	95
Size:	13.9 KB
ID:	726  
  #19  
Old June 5th, 2014, 03:50 AM
stefan stefan is offline
 
Join Date: Feb 2008
Posts: 5,901
Default

Quote:
Originally Posted by kidnkaboodle View Post
thanks - my bad. I updated the code and the canonical tag has since disappeared and title tag has the store removed i.e.[ category page | ] (see attached)

http://www.kidnkaboodle.com.au/store/category/bedtime/
You have this in The Factory > Your Store > VIEWS > CATEGORY PAGE > Default > View menu > View <head> Elements

<title>[category.name] | [store.name]</title>

The [store.name] shortcode does not exist.
  #20  
Old June 23rd, 2014, 03:16 AM
Florent51 Florent51 is offline
 
Join Date: Jun 2014
Posts: 14
Default

Hi guys,

Am I doing something wrong ? It doesnt work for me :

vetementenligne.be/category/marque

Thanks !

Quote:
function dfr_remove_wpseo_canonical( $canonical ) {
if (is_dfr()) {
$canonical = false;
}
return $canonical;
}
add_filter( 'wpseo_canonical', 'dfr_remove_wpseo_canonical' );


function dfr_remove_wpseo_title( $title ) {
global $wpseo_front;
if (is_dfr()) {
remove_filter('wp_title', array($wpseo_front, 'title'), 15, 3 );
}
}
add_action( 'init', 'dfr_remove_wpseo_title' );


add_filter( 'wpseo_opengraph_title', 'my_opengraph_title' );
function my_opengraph_title( $title ) {
if (is_dfr()) {
$title = $GLOBALS['DFR_PLUGIN']->shop_content->title;
}
return $title;
}
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Datafeedr wordpress plugin tewfic Questions 5 August 6th, 2012 11:21 AM


All times are GMT -5. The time now is 02:54 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.