How to replace native comment_count with Comments Evolved aggregate count

Few issues here. use add_filter() instead of apply_filters(), to register your custom callback. return the value within your filter’s callback. use the get_comments_number filter instead of the comments_number filter, since you only want to change the number and not the whole output of the comments_number() function. prefix the name of your custom callbacks, to avoid … Read more

wp_query (or hook) posts by date (id) in array then set post_type

Thank to @pietergoosen for “jokingly” giving me the answer. function gm_gather_posts_in_array() { $set_days_before=”1275″; $posts_to_be_processed = date(‘Y-m-d’, strtotime(“today – $set_days_before days”)); $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘posts_per_page’ => -1, ‘fields’ => ‘ids’, ‘date_query’ => array( array( ‘before’ => $posts_to_be_processed ) ) ); $posts_to_be_processed = new WP_Query( … Read more

Setting ‘post_format’

You can add an action to wp_insert_post(). The cool thing about it is the third parameter – $update, because it allows you to only set the post_format once, and you can change it later. This is necessary because the function wp_insert_post() is not only called on the creation, but also on update etc. add_action( ‘wp_insert_post’, … Read more

dropdown with no submit

You can use “get_page_link” function to Retrieves the permalink for the current page (if in The Loop) or any arbitrary page ID if passed as the first argument. something like this: <a href=”https://wordpress.stackexchange.com/questions/219011/<?php echo get_page_link( $page->ID ); ?>”><?php echo $page->post_title; ?></a> Reference: https://codex.wordpress.org/Function_Reference/get_page_link