I really like this plugin, and have managed to tweak a couple of things like changing the default sort order and getting rid of the author field.
I'd really like to be able to hide the years there are no blog posts in the year dropdown box... any way to do this?
Customizable Entries Archive - hiding inactive years ...
Re: Customizable Entries Archive - hiding inactive years ...
I don't use or even know the plugin at all. There might be a config option for this, but you have probably already checked the plugin config?Christine wrote:I'd really like to be able to hide the years there are no blog posts in the year dropdown box... any way to do this?
YL
Re: Customizable Entries Archive - hiding inactive years ...
Yeah, I have checked the config options, unfortunately there's nothing like that there - only options are permalink url and 'format as article'.
Re: Customizable Entries Archive - hiding inactive years ...
I would say: No!Christine wrote:I'd really like to be able to hide the years there are no blog posts in the year dropdown box... any way to do this?
And this, since that is build by a simple counter which does not really interfere with entries, accept for the start year.
Code: Select all
$custom_sortyears = array();
$custom_sortyears[] = array('value' => 'all', 'desc' => COMMENTS_FILTER_ALL);
for ($i = $first_year; $i <= date('Y'); $i++) {
$custom_sortyears[] = array('value' => $i, 'desc' => $i);
}
You could "hack" this, since this are probably years that do not change any more, replacing the above part by
Code: Select all
$exclude_years = array('2007','2009','2012');
$custom_sortyears = array();
$custom_sortyears[] = array('value' => 'all', 'desc' => COMMENTS_FILTER_ALL);
for ($i = $first_year; $i <= date('Y'); $i++) {
if (in_array($i, $exclude_years)) continue;
$custom_sortyears[] = array('value' => $i, 'desc' => $i);
}
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: Customizable Entries Archive - hiding inactive years ...
Brilliant! It worked perfectly. Thank you so very much .