I apologize… I was being a bit dense. (Or, I didn’t read the title of the thread, just the message itself.)
I was thinking you were talking about your theme’s archive.php
file, not the one in the plugin.
There’s not a way to directly modify this in the plugin, but the plugin is using a hook to customize the title, so you could extend it a bit further.
Right now the plugin is using closures (anonymous functions) for its hook modifications. I should really change that. Anyway, I think you should be able to alter the title with this:
add_filter('get_the_archive_title', function($title) {
if (strpos($title,'On This Day') === 0) {
$title = 'YOUR MODIFIED TITLE HERE';
}
return $title;
}, 11, 1);
This is going to hijack the modification the plugin makes and make a further alteration to it. You may need extra code if you want to pull in anything dynamic like the date.
Here’s the code that’s in the plugin itself, in archive.php
lines 42-55:
// Change archive title
add_filter('get_the_archive_title', function($title) {
global $wp_query;
if ($wp_query->is_main_query() && get_query_var('r34otdarchive')) {
if ($r34otddate = get_query_var('r34otddate')) {
$date = strtotime(substr($r34otddate,0,2) . '/' . substr($r34otddate,2,2) . date('Y'));
}
else {
$date = current_time('timestamp');
}
$title = _('On This Day') . ': ' . date('F j', $date);
}
return $title;
});
Don’t modify this directly in the plugin because it will get overwritten when the plugin is updated.
-
This reply was modified 4 years, 9 months ago by
room34.