Closed dotherightthing closed 8 years ago
Hi Dan,
Please try downloading the feature/default_subtitle
development branch of the plugin and see if this works for you:
https://github.com/benhuson/wp-subtitle/tree/feature/default_subtitle
It introduces a default_subtitle
filter (like the WordPress default_title
filter) which you can use like this:
function my_default_subtitle( $post_title, $post ) {
// $post is the current post object if you want to customise the default subtitle
return 'My Default Subtitle';
}
add_filter( 'default_subtitle', 'my_default_subtitle', 10, 2 );
Will that work for you?
Let me know and if it looks good I'll merge into the core plugin.
Thanks
Ben
Please note, the filter has now been changed to wps_default_subtitle
and is available in version 2.8
I'd like to use your plugin to output custom field values above the featured image.
This means that I only ever populate the subtitle programatically via:
However this only works if the subtitle has a value assigned, otherwise nothing is output.
There is a
default_title
function in Wordpress (https://developer.wordpress.org/reference/hooks/default_title/). If you could add adefault_subtitle
function I would be able to programatically set a default value for the purpose of overwriting this with the code above.Many thanks, Dan