create metabox to activate slider

Don’t bother with the checkbox and metabox, that’s limiting: You’re only able to have a single slider, and have to add code for every new slider to add a new checkbox Data gets stored in post meta as a custom field, but querying posts by their post meta is super expensive and slow So I … Read more

How to split a post and intercalate elements from a loop

You can buffer the template part to use it within post content: <?php add_filter( ‘the_content’, ‘add_related_each_nth_p’ ); function add_related_each_nth_p( $content ) { if ( ! is_single() ) { return $content; } // the interval between added content $paragraph_steps = 3; // declare empty output $output=””; // declare related posts offset $z = 0; // make … Read more

Count identical post titles

I’m assuming your original code has a closing } at the end, like this: <?php global $post; $postslist = get_posts( array( ‘post_type’ => ‘reviews’, ‘posts_per_page’ => 20, ‘order’=> ‘ASC’, ‘orderby’ => ‘date’ ) ); foreach ( $postslist as $post ){ setup_postdata($post); // Tag counter $post_tags = get_the_tags($post->ID); if ($post_tags) { foreach($post_tags as $tag){ echo ‘<span … Read more