Custom URLs between different post types, using “Pods”
Custom URLs between different post types, using “Pods”
Custom URLs between different post types, using “Pods”
function add_custom_status_class( $classes, $class, $post_id ) { if ( ‘request’ === get_post_type( $post_id ) ) { $status = get_post_meta( $post_id, ‘hrs_field_status’, true ); if ( $status === ‘accepted’ ) { $classes[] = ‘status-accepted’; } elseif ( $status === ‘rejected’ ) { $classes[] = ‘status-rejected’; } } return $classes; } add_filter( ‘post_class’, ‘add_custom_status_class’, 10, 3 ); … Read more
How to consume external API from WordPress post editor and display the response data in the custom field?
Need help creating a WordPress site that has a landing page and sub pages for an area (for example, “London”). Website will have 100’s of areas
First, go to wherever you defined the custom post type. For instance, if I were writing a function to define a custom post type “books”, I would use register_post_type( ‘books’, $args ) where $args is an array used to configure the post type properties. By default, custom post types use the post type key as … Read more
Figured it out, it was simpler than I expected. /** * Include catalog posts in archives, even though they’re not “public” * * @param WP_Query $query * @return WP_Query */ function wpse415668_catalog_posts_in_archives(WP_Query $query): WP_Query { if (! $query->is_admin() && $query->is_main_query() && $query->is_tax(“catalog_category”)) { $query->set(“post_type”, “catalog”); } return $query; } add_filter(“pre_get_posts”, “wpse415668_catalog_posts_in_archives”);
What would be the optimal CPT / Taxonomy design for the following entities structure
Show content from pages based on Current Date
WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query
Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template