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

Custom Post Archive – display page 1 differently then subsequent pages

It sounds possible. Archive pages have a built in query they execute if you want to filter you can create a template for just that category such as archive-{category}.php or if your going to filter more information like described you should use. add_action( ‘pre_get_posts’, ‘my_change_sort_order’); function my_change_sort_order($query){ if(is_archive()): //Set the order ASC or DESC $query->set( … Read more