Hello Frvncesko,
We have looked into the Secondary Title conflict with our filters reported by you, and it certainly does not work in AJAX mode: line 213 of Secondary Title’s v2.0.8 hooks.php file (secondary_title_auto_show function) blocks out any is_admin() call, which (due to the nature of WordPress AJAX calls) simultaneously blocks out any AJAX call as well. If you wish, you can contact the Secondary Title developers to see if they are interested in introducing AJAX support.
As for now, there are only 2 things that you can do to get your secondary titles working:
1. Set your filters preset to URL filters Filtering style
2. If you badly need the AJAX mode, and have a child theme activated on your site, you can try introducing a temporary fix by adding something like this to functions.php:
if( is_ajax() ) {
if( function_exists( 'get_secondary_title' ) ) {
add_filter( 'the_title', function( $title ) {
global $post;
$secondary_title = get_secondary_title();
if ( ! $secondary_title || get_option( "secondary_title_auto_show" ) === "off" || $title !== wptexturize( $post->post_title ) ) {
return $title;
}
/** Apply title format */
$format = str_replace(
'"',
"'",
stripslashes( get_option( "secondary_title_title_format" ) )
);
$title = str_replace(
"%title%",
$title,
$format
);
$title = str_replace(
"%secondary_title%",
html_entity_decode( $secondary_title ),
$title
);
return $title;
} );
}
}
The above code has been drafted based on the contents of the secondary_title_auto_show function, and though may work indefinitely, comes with all sorts of disclaimers!
Hello devs, I’ve added the following code to the functions.php file of my child theme, and worked perfectly as i wanted! I am extremely grateful to you all for the fast and effective support regarding my case. I am more than happy to change my review from 3 stars to 5 stars as promised. You can close this topic, thanks again. Cheers!
-
This reply was modified 7 months, 1 week ago by
frvncesko.
Hello Frvncesko,
Thank you so much for the feedback, it’s great to hear that the proposed fix has resolved the Secondary Title issue!
I will mark this thread as resolved, but before I do, please let me also thank you for supporting the further plugin development with your 5-star review!