Default to ‘all’ view on the ‘edit-post’ screen for authors

Thank’s anmari, A tad over my level of php knowledge, but manage to sort it out looking at it in another way. Sorted with changing the “global $submenu” and the code: /** * Makes the “All” sorting and “publish” default on edit screen for custom post types */ function default_post_sorting(){ global $submenu; // Administrator users … Read more

Apply a style for 4 blogs and another style for the next 4 blogs in wordpress blog page?

In the following code you could add a class specifically based on the position in the loop: <?php /* Start the Loop */ $i = 1; $class=”first-class”; while ( have_posts() ) : the_post(); if($i % 4 == 0){ $class=”second-class-“.+$i; } echo ‘<div class=”‘.$class.'”>’ get_template_part( ‘template-parts/content’, get_post_format() ); echo ‘</div>’ $i++; endwhile; ?> This is essentially … Read more

Insert Content In Between Post Feed

I’ve found old pieces of code and joined it with yours. It could be more elegant, but you have the idea. <?php $args = array( ‘category__not_in’ => array( 20 ), ); $query = new WP_Query( $args ); $posts = $query->posts; wp_reset_postdata(); $post_counter = 1; // secondary posts’ categories (ids) $sec_categories = [2, 14, 56, 234]; … Read more