Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
Taxonomies relations
UPDATE 1: I haven’t find a solution yet (other than using Polylang Pro). But I must add that my original question was partially wrong, since the rewrite option is for the single page url, not the archive one. Custom post type archive has its own slug and it’s the has_archive option (can be boolean or … Read more
The post type argument needs to be written as post_type, but you are using it as post-type. Change your argument to this: $args = array( ‘post_type’ => ‘portfolio’ );
The page itself is a custom post type, you can notice this when you open the edit page screen. Your URL will be like this: www.example.com/wp-admin/edit.php?post_type=page This means you are on a page post type. Now about your code, the first condition of your conditional determines if you are on a page post type or … Read more
I found a solution! I was able to find a function that modified the query on the category page (https://wordpress.org/support/topic/custom-types-category-pagination-404/#post-1913902 – on the first page toward the bottom, written by: Mark / t31os). Add this to functions.php: add_action( ‘parse_query’,’changept’ ); function changept() { $category = get_query_var(‘cat’); $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; if (is_category() … Read more
first thing that i notice, is that you use some obscure WP loop markup foreach( $myposts as $post ) : setup_postdata($post); Please loop with standard markup an WP_Query class <?php $query = new WP_Query( $args ); ?> <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?> https://codex.wordpress.org/The_Loop Next thing, that is … Read more
Add post location with mile radius allowing search
I managed to answer this question myself by adding get_queried_object()->term_id; instead of the taxonomy terms ID. It now outputs all the grandchild taxonomy terms for the current taxonomy term. Here is my updated working code: $term_id = get_queried_object()->term_id; $taxonomy_name=”product_range”; $term_children = get_term_children( $term_id, $taxonomy_name ); echo ‘<ul>’; foreach ( $term_children as $child ) { $term … Read more
Sort and filter custom post type posts by custom taxonomy