Hi @renlong,
Thanks for your kind words, and for taking the time to bringing this issue here.
So, basically, you’d like to get the “raw” title in PHP while still using Secondary Title’s “Auto show” function?
If that’s the case, you’d have to access the post as an object. Like this (untested):
$posts = get_posts(['post_type' => 'post']); // Your individually queried posts
foreach($posts as $post) {
echo "This is " . $post->post_title;
}
Or did I misunderstand your question? If so, please explain it a bit further so we can find a solution for you 🙂
-
This reply was modified 2 years, 11 months ago by thaikolja.
@thaikolja
Dear thaikolja, I am much grateful for your patient reply, I know that the spirit of selfless dedication is priceless.
One of the most important issues I found in use, the %title%%secondary_title% in plug-in Secondary Title automatically turn the subtitle into part of the title in HTML structure. In my case, this output result will have an HTML tag. This nature causes some problems when sharing the article (I have sent an email to you, I believe the screenshot above may explain more clearly.).
If after using the code get_the_title()
(Or other similar code), the plugin outputs the original title, instead of the conversion title (which combined %title% and %secondary_title%), this problem may be alleviated. (HTML code should not appear in the title of sharing articles). Are you interested in implementing the feature get_the_original_title()
?
Anyway, thank you for your dedication and time. Take care, and I hope you have a pleasant day.
Best regards,
Renlong
-
This reply was modified 2 years, 11 months ago by Renlong.
-
This reply was modified 2 years, 11 months ago by Renlong.
You can always turn off “Auto show” and use PHP instead. Without “Auto show”, it only appears where you place the PHP code <?php echo get_secondary_title($post_id); ?>
.
I’m currently building a full documentation for all features under https://docs.thaikolja.com/secondary-title/ which might be of help.
If you have more ideas, please go ahead, I’m always up for improvements.
This looks a better workaround, I will have a try. Best