Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Does Yoast SEO Wordpress Plugin Work With Simple Press?
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Apr 28, 2013 - 3:16 pm

if you dont modify core, but make a plugin or put it in the spFunctions.php file of your theme (one you created from ours as a base), it will be unaffected by SP updtes...

Avatar
Roberto Villabona
Member
Offline
Jul 8, 2013 - 12:45 pm

Hi guys,

I'm using the same set of software (Catalyst, WP SEO, Simple:Press) and experienced exactly the same problems slobizman encountered.  I found the combination of settings that was able to make use of the suggested fixes by Mr Papa, however you have to make the following changes to that part that fixes the browser title:

1.  Instead of

add_filter('wp_title', 'sp_setup_browser_title', 99, 3);

Use:

add_filter('wp_title', 'sp_setup_browser_title', 19, 3);

That's because Catalyst calls add_filter('wp_title', ...) with its own function that optionally wraps the title then outputs it, using priority number 20 (line 53 of catalyst-header.php).  I'm not a PHP/WP programmer so I can't say this with certainty but I kinda figured S:P needs to do its thing on the page title before the theme actually outputs it.  Just not sure what other filters are applied between the default '10' and '19'.  I got the idea to search where Catalyst outputs the title when I read this woman's alternate (non-Catalyst) solution:

http://bonplangratos.fr/forum/.....press-post

Then I also applied the custom function described earlier to fix the canonical entries and it worked.

I'd like to request some guidance on how I could make the change I made survive a Simple:Press update.  Thanks!

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Jul 8, 2013 - 3:39 pm

OK - I admin it... I am hoping I don't have to read the 41 posts before yours to get a handle on your question and that you really ARE just asking about preserving theme changes.smile

And if that is right then we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/)

Of course we do - from time to time - need to make a theme change but these are documented with qach release and we do try and minimise these as much as possible.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Roberto Villabona
Member
Offline
Jul 8, 2013 - 4:15 pm

I already am using my own SP theme which I made following the instructions on how to derive one from the existing ones.

The add_filter() code in my previous post was supposed to have been a fix Mr. Papa made to the SP core's future release (inside sp-load-forum.php) which I just modified here to work on Catalyst Theme, by changing the parameter 99 to 19.  Mr. Papa's original post is here:

https://simple-press.com/suppo.....2/#p125578

My specific question then is: How do I make the equivalent of that add_filter() code part of my custom SP theme instead of being part of the core?  Sorry I'm not a WP/PHP programmer -- I do have a rough grasp of the WP loop and the concept of hooks and filters, but not enough to really figure out how to do it.

I imagine I must add something like this to spFunctions.php of my custom theme:

function my_sp_setup_browser_title() { 

  add_filter('wp_title', 'sp_setup_browser_title', 19, 3);

}

The thing is I'm sure I'm missing a lot -- like how to reverse the original add_filter() call in the core to make sure this is the one that applies, as well as where I should hook my custom function.  Am I making sense?

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Jul 8, 2013 - 4:42 pm

Ah. Understand. I think.
I assume he was intending that the original in-core filter be removed in favour of this one but the best thing I can do is probably ask him so please bear with me...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Jul 8, 2013 - 9:00 pm

well, must say at bit lost... a long topic with multiple related topics...

I am not sure which part of this topic you are trying to do...  I did not offer a way to change the priority outside of sp core... I offered a way to work with wp seo from yaost and some other stuff (like name adjustment) via non core stuff...  so not entirely sure what you are referencing... and why you need to change 99 to 19 when the other user (slobizmen) didnt need to with catalyst...

I cannot really think of an easy way to change it - you cannot override it..  but you can remove the action... but if we change it, you will have to change...

so maybe something like this:

add_filter('sph_forum_startup', 'my_sp_start');
function my_sp_start() {
  remove_filter('wp_title', 'sp_setup_browser_title', 99, 3);
  add_filter('wp_title', 'sp_setup_browser_title', 19, 3);
}

but that 99 needs to be whatever the priority is...  currently its different in 5.2.6 from what it will be in 5.3...

or please explain further if I have misunderstood...

Avatar
Roberto Villabona
Member
Offline
Jul 8, 2013 - 11:56 pm

Mr Papa said
well, must say at bit lost... a long topic with multiple related topics...

I am not sure which part of this topic you are trying to do...  I did not offer a way to change the priority outside of sp core... I offered a way to work with wp seo from yaost and some other stuff (like name adjustment) via non core stuff...  so not entirely sure what you are referencing... and why you need to change 99 to 19 when the other user (slobizmen) didnt need to with catalyst...

I cannot really think of an easy way to change it - you cannot override it..  but you can remove the action... but if we change it, you will have to change...

so maybe something like this:

add_filter('sph_forum_startup', 'my_sp_start');
function my_sp_start() {
  remove_filter('wp_title', 'sp_setup_browser_title', 99, 3);
  add_filter('wp_title', 'sp_setup_browser_title', 19, 3);
}

but that 99 needs to be whatever the priority is...  currently its different in 5.2.6 from what it will be in 5.3...

or please explain further if I have misunderstood...

Hi, 

I was trying to solve exactly the same thing slobizman had problems with -- WP SEO's compatibility with S:P, as well as that part where the title was appearing on top of the page but not in the browser tab title area (which appeared to be a conflict with Catalyst Theme).  From what I read in this thread (and slobizman's posts in the Catalyst Theme forum), the change to add_filter() you told him to use didn't work with Catalyst Theme (I can attest to that since I saw the same problems).  He seems to have ended up ditching WP SEO and used a plugin to transfer its settings to the built-in Catalyst Theme SEO.  I'm not sure if he tried what I did.

I just posted here to say there seems to be a way to make it work with Catalyst Theme, if you replace the 99 priority with 19 (any number between 15-19 seems to work too).  Just really needed help in trying to figure out if there's an "update-proof" way to make this change... but it seems there is none since I need to know the exact priority of the add_filter() call within sp-load-forum.php to be able to call remove_filter() on it.  But thanks for the code -- at least it's something I can still use so I can keep my modifications separate from the core.

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Jul 9, 2013 - 3:33 am

I would use the code above that removes the original. OK - so the priority will change in SP5.3 and will your code will need editing when but it is most unlikely to change again after that.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625