How to create archive child pages with good Yoast SEO meta?
How to create archive child pages with good Yoast SEO meta?
How to create archive child pages with good Yoast SEO meta?
Archive page for custom post type shows regular posts, too (by category)
This is going to be dependent upon how you created the custom post type. If you actually just created a post type called book and didn’t create any rewrites then all you have to do is link to /book. There’s nothing amateur about doing it this way…that’s how WordPress is designed. The only thing I … Read more
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
If you are using a custom loop. Please use $query->post to get the post object.
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
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 type archive url when post type has archive string
In your register_post_type function you set your publicly_queryable and public flags to false. If you don’t make your post_type publicly_queryable and public, the front-end will simply ignore it. Source: developer.wordpress.org
CountUp timer for custom post