Custom Post Type Permalink empty
Custom Post Type Permalink empty
Custom Post Type Permalink empty
I think it is better to connect with taxonomy terms. Since you can add any custom fields to terms using ACF / another plugin / code, it is possible to use terms with images, full description etc. I had similar task, this tutorial should be helpful https://rudrastyh.com/wordpress/taxonomy-slug-in-post-type-url.html. Yes, I know that there is no hierarchy … Read more
You have to tell WP that archive.php should apply to your custom post type as well as it’s other defaults. You can use pre_get_posts filter to do this, be sure to research this well before using it as there is a right and wrong way to use this filter. For example, try: function add_custom_post_type_to_archiving( $query … Read more
try something like $paged = ( get_query_var(‘page’) ) ? get_query_var(‘page’) : 1; args = array( ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘post_type’ => ‘event-calendar’, ‘posts_per_page’ => 5, ‘paged’ => $paged ); $query = new WP_Query( $args ); while ($query->have_posts()){ // do stuff }
Portfolio Page for Classic Posts
As has already been noted, you can do this by iterating over each of the terms, which are WP_Term objects. Each of those WP_Term objects has a name property. So you’d do it like this: $terms = get_the_terms( $post->ID, ‘cpt_saving-type’ ); $terms = is_array( $terms ) ? $terms : array(); foreach ( $terms as $term … Read more
After a short sleepless night with this running through my head, I have a solution that works. I’m not sure if it’s the best solution but for those that may have a similar problem, here’s what I did. First, I abandoned trying to use the WordPress request filter for this particular ordering. Instead, I used … Read more
Add custom field in comments form
I think you would be better off using get_posts or a new WP_Query instead of get_term_by. That would allow you to get posts for your custom post type, and then filter by taxonomy/term name. If you’re comfortable enough with WP Query you could try something like this: Query posts by taxonomy term name
I am not able to be exactly sure about your problem, maybe a live example may help. Also, do you have a custom post status “new” or its a typo? but looking at the code, I see you have begun the table code outside the while loop, which is correct but ended it inside the … Read more