Shortcode with ‘year’ parameter

With help from @bosco , I was able to figure it out. Below is the working code: //get archived posts per year add_shortcode( ‘archived-posts’, ‘archived_posts’ ); function archived_posts($atts) { $a = shortcode_atts( array( ‘year’ => date(‘Y’) ), $atts ); $q = new WP_Query(array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1 , ‘post_status’ => ‘archive’ , ‘year’ … Read more

Change page creation layout

Your second image is of the Classic Editor. You can get it by installing the Classic Editor plugin: https://wordpress.org/plugins/classic-editor/

wordpress posts template remove default template from menu

If you want to change only the text you can hook into default_page_template_title add_filter(‘default_page_template_title’, ‘bt_change_default_page_template_title’, 10, 2); function bt_change_default_page_template_title ($text, $meta) { if ($meta === ‘meta-box’) return ‘My custom template’; return $text; } Add this code into functions.php and thats it. Tested on a clean wordpress install, this will only change the text and nothing … Read more

How to group only VISIBLE posts? [closed]

Give the divider an attribute, ie: data-target=”.group_20211006″ and add class to the post container, ie: class=”blah group_20211006″. After the filter changes, loop through each divider and check if there’s any visible post container with matching date value. HTML <!– First Group –> <div class=”divider” data-target=”.group_20211001″>October 1, 2021</div> <div class=”post-1 group_20211001″>…</div> <div class=”post-2 group_20211001″>…</div> <div class=”post-3 … Read more