Support Forum
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...
Visit Cruise Talk Central and Mr Papa's World
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!
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.
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.
YELLOW
SWORDFISH
|
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:
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?
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...
Visit Cruise Talk Central and Mr Papa's World
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.