How to convert hierarchical Pages to hierarchical Custom Post Types? Slugs get a number as if they were duplicates
How to convert hierarchical Pages to hierarchical Custom Post Types? Slugs get a number as if they were duplicates
How to convert hierarchical Pages to hierarchical Custom Post Types? Slugs get a number as if they were duplicates
In meta_query, you missed the type of the field: $args = array( ‘post_type’ => ‘events’, ‘posts_per_page’ => ‘-1’, ‘meta_query’ => array( array( ‘key’ => ‘event_date_start’ , ‘compare’ => ‘>=’, ‘value’ => current_time(‘Ymd’), ‘type’ => ‘DATE’, ) ), ‘meta_key’ => ‘event_date_start’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’ );
Google analytics not picking up custom post type
Use the the_date() or get_the_date( ‘d/m/Y’, $post->ID ) functions. This will show only the date of your post type. If you are outside the loop, you need to use the second function I’ve suggested with the post id passed as param.
Yes, you can retrieve the saved meta value and pass it as a parameter to a shortcode. First option is to get the saved value to a variable, validate it and then concatenate it to a shortcode string you pass to do_shortcode(). // get saved meta value $form_id = get_field(‘your_key_for_form_id_here’); // make sure we have … Read more
Dynamic page for nav items used as filters
See this answer for solution, see comments there about error messages. That should work with Classic editor. It could work with Gutenberg too, but it would need additional effort to get correct error messages. UPDATE: If using classic editor and preventing publishing of invalid records is enough, you can use this code: function my_save_post($post_id) { … Read more
WP_Query only returns WP_Post objects for the results. To get the taxonomy terms for each post you need to use get_the_terms( $post, ‘recipe_categories’ ); for each post. This is because WP_Post represents each row of wp_posts, which does not include taxonomy information. The links between posts and terms is in the wp_term_relationships table.
The loops itself is working. I guess you have trouble to output this content on some page template. There are many ways how to show output of this loop on the homepage. 1.You can create home.php file, put there your code and in theme settings select which page should output your custom post type. 2.You … Read more
Try this: in archive-header.php line 8 – 10 by interecepting the variable “period=past” or ( I guess) “period = future” of current URL <?php else : if( !empty($_GET[‘period’] ) && $_GET[‘period’] == ‘past’) { echo “Past Events”; } elseif( !empty($_GET[‘period’] ) && $_GET[‘period’] == ‘future’ /*or whatever*/){ echo “Upcoming Events”; } else{ echo esc_html(lsvr_pressville_get_event_archive_title());//the default … Read more