The blog has been open for more than a year, and one of the sidebars is output according to the month. As time goes on, it becomes long and smelly. Are you trying to make it shorter? My first idea is the drop-down list OK, If you have an idea, the next step is to realize it. Anyway, if there is a problem, it is Google I believe it won't let me down. As expected, I found clues
The next step is testing. It will be ready soon. You don't need to modify many places, but just cover the code listed in the original list. Let's share the code below
On the sidebar, find the "article archive" (of course, according to the actual situation, different people have different names)
<? php wp_get_archives('type=monthly'); ?>
Replace with the following code:
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><? php echo esc_attr(__('Select Month')); ?></ option> <? php wp_get_archives(apply_filters('widget_archives_dropdown_args', array('type'=> 'monthly', 'format'=> 'option','show_post_count'=> $c))); ?> </select>
OK. It's that simple
see wp php code Related articles for
Please specify that the original article of this website is reproduced from To be kicked , Link: https://www.itlu.net/articles/1304.html