How to prevent Widget from echoing to wrong position in DOM

dynamic_sidebar will output the sidebar when it is called. Try using it with buffering and store into a variable as below: <ul class=”menu”> <?php $locations = get_nav_menu_locations(); if ( isset( $locations[ ‘mega_menu’ ] ) ) { $menu = get_term( $locations[ ‘mega_menu’ ], ‘nav_menu’ ); if ( $items = wp_get_nav_menu_items( $menu->name ) ) { foreach ( … Read more

Custom archive widget drop down menu

The archives widget uses the wp_get_archives function to generate the dropdown list. As you can see from the source code, there is no native way to use other dropdowns than yearly/monthly/weekly/daily. Unfortunately, there also is no hook to insert your own quarterly dropdown. So, there is no easy way to do this. There is a … Read more