[Plugin: Organize Series] use 'short' title in navigation box
-
I really like the plugin Organize Series (current version 2.5.0), but as other people already requested in this and this closed posts, the ‘short’ title that can be set for a post doesn’t get used for the box with navigation links at the top of the post when the option “Display series meta information with posts” is enabled. The ‘short’ title seems to be for widget use only and the navigation box always shows the full title, which can be quite long sometimes.
I wanted to share how to slightly modify the code to get this to work as such in case other people also want this behavior:
Modify the function
token_replace
in the file orgSeries-utility.php by finding the following code (at line 109 in version 2.5.0 of the plugin):if( stristr($replace, '%post_title%') ) $replace = str_replace('%post_title%', series_post_title($id, FALSE), $replace); if( stristr($replace, '%post_title_linked%') ) $replace = str_replace('%post_title_linked%', series_post_title($id), $replace);
And insert the following lines right below those:
if( stristr($replace, '%post_shorttitle%') ) $replace = str_replace('%post_shorttitle%', series_post_title($id, FALSE, get_post_meta($id, SPOST_SHORTTITLE_KEY, true)), $replace); if( stristr($replace, '%post_shorttitle_linked%') ) $replace = str_replace('%post_shorttitle_linked%', series_post_title($id, TRUE, get_post_meta($id, SPOST_SHORTTITLE_KEY, true)), $replace);
This adds two supported replaceable tokens to the list. Instead of
%post_title%
and%post_title_linked%
you can now also use%post_shorttitle%
and%post_shorttitle_linked%
in the plugin options:- Series Post List Post Title Template
- Series Post List Current Post Title Template
That’s it!
- The topic ‘[Plugin: Organize Series] use 'short' title in navigation box’ is closed to new replies.