WordPress Rewrite Url with arugments

Instead of using $_SESSION variables we’ll register a query variable. function wpa_91718_query_var( $vars ) { $vars[] = ‘event_page’; return $vars; } add_filter( ‘query_vars’, ‘wpa_91718_query_var’ ); Then we can modify the query before it is run using pre_get_posts. If I understood you and your code correctly, then if the query var is present in the URL, … Read more

Customing Annual Archive plugin

Try this, you need to use two filters “getarchives_where” and “getarchives_join” to alter the way archive are shown and include your category 17.. function widget( $args, $instance ) { extract($args); //$c = $instance[‘count’] ? ‘1’ : ‘0’; //$d = $instance[‘dropdown’] ? ‘1’ : ‘0’; $format = empty($instance[‘format’]) ? ‘html’ : apply_filters(‘widget_type’, $instance[‘format’]); $type = empty($instance[‘type’]) … Read more

get custom post archieve by month

I had some problem with wp_get_archives, you can try my solution of this issue function get_cpt_archives( $cpt, $echo = false ) { global $wpdb; $sql = $wpdb->prepare(“SELECT * FROM $wpdb->posts WHERE post_type = %s AND post_status=”publish” GROUP BY YEAR(wp_posts.post_date), MONTH(wp_posts.post_date) ORDER BY wp_posts.post_date DESC”, $cpt); $results = $wpdb->get_results($sql); if ( $results ){ $archive = array(); … Read more

tech