Articles of custom post types

Filter posts of custom post type by meta key in (List All Section)

How can I filter the posts which are displayed on the admin list all page of a custom post based on the value of the a value. So far I know how to do the following anywhere on the front end: $args = array( ‘meta_key’ => ‘magic_key’, ‘meta_value’ => $post_id, ‘post_type’ => ‘question’, ‘post_status’ => […]

How to Organize and Sort Gallery of Images

I’m working on a website for an artist. He has many images that he would like a user to be able to sort and filter by custom taxonomy. In addition, he would like a user to be able to navigate through a hierarchical gallery with folders (that display a thumbnail) for each level of the […]

Validate Custom Post Type fields

I’m developing a plugin, in which the administrator has the ability to add and remove ZIP codes on the backend. I found that the best way to do this is by creating a custom post type named zip_code with only a title being supported , as that functionality is already built-in to WordPress. What I’m […]

Change post type depending on shortcode

Is it possible to use 2 shortcodes with the same function and change only the post type in the function depending on what shortcode it is? For instance, when I use all_faq shortcode the post type should be Faq. When I use wordpress_faq then the post type should be wp-Faq. It works now but is […]

What happens to my older posts if I switch to a child theme?

I have a theme that has one custom post type. I want to mess with its templates and styles.css file. What happens to my older custom posts in case I switch to using the child theme. Do they vanish?

meta query not retrieving posts

I am attempting to use get_posts() to retrieve posts that have certain topics attached to them, in my custom post type named ‘leaders’ Here is my query. $args = array( ‘post-type’ => ‘leaders’, ‘meta_query’ => array( array( ‘key’ => ‘topics’, ‘value’ => ‘1773’, ‘compare’ => ‘LIKE’ ) ) ); $test = get_posts( $args ); If […]

same archive template for different custom post

Suppose i have registered five custom post type like this america china nepal norway chile And to template the archive i should use like this inside theme folder isn’t it? archive-america.php archive-china.php and so on? But the thing is all of them have same code? And i don’t want to make five files with same […]

Post format or Type for List Type Posts

I want to create a post type / format where I can create list type posts… For example… h1.Title: The List Post Title like “Best Salads…” – Intro paragraph h2. Best Veg Salads – Intro — h3. Salad #1 — h3. Salad #2 .. — h3. Salad #X h2. Best Non-Veg Salads – Intro — […]

Overriding Plugin Function in Child Theme

I have a plugin and a custom post type class like this. I want to override one its function in my child theme. class Inspiry_Property_Post_Type { /** * Register Property Post Type * @since 1.0.0 */ public function register_property_post_type() { $labels = array( ‘name’ => _x( ‘Properties’, ‘Post Type General Name’, ‘inspiry-real-estate’ ), ‘singular_name’ => […]

Group by custom field value (start and end times)

I have the following loop that is outputting a schedule for a conference. At the moment it’s looping through a custom post type, grabbing the info, then outputting it in a block. So essentially each block is a timed session. Is it possible to put any items that have the same time in 1 block? […]