Articles of custom post types

Display list of custom post type which match taxonomy

I’m trying to add a snippet in my WordPress sidebar which displays a list of links to posts which match a criteria. I’m using a Custom Post Type cars and a taxonomy car-types and I’d like to display a list of links to cars which are part of the car-types taxonomy. So in short. Display […]

Custom post types, disable fields

I have a plugin that is syncing data from a third party service into a custom post type. The idea is that the post type acts as a slave to the third party service, so any changes there overwrite any on the wordpress site. However there will be a few extra custom fields that will […]

WP_Query get post from a category and from another post type

I have 2 post types (post and help). In post (post type), there is a category named “Hello” and I want to get all posts from the category “Hello” (post_type = post and category_id = 2) and all posts from the post type “help” with a uniq WP_Query. This doesn’t work: $categoryId = 2; $page […]

Template tags to display custom post type posts in category template?

I am developing a custom theme with custom post types involved. Custom post types have been defined via plugin ‘Pods’ (http://pods.io). When writing a category.php, I realized, that the standard loop does not retrieve custom post types (CPT) posts which belong to a certain category. Is that right? If not, are there any template tags […]

archive-{$post_type}.php not loading. instead the default archive.php loads

My has-archive is set to true in the register_post_type. My archive-portfolio.php exists. I’ve tried flushing rewrite rules. I’ve tried a lot of other stuff, and after every step, I reset/saved/resaved/refreshed my permalink structure. This is my register_post_type register_post_type( ‘portfolio’, array( ‘labels’ => array( ‘name’ => __( ‘Portfolio Items’ ), ‘singular_name’ => __( ‘Portfolio Item’ ), […]

Add arguments to get_the_terms for custom post types

When using get_the_terms to retrieve terms within a taxonomy for a custom post type you can’t pass arguments, like so: function custom_cat_function() { global $post; $args = array( ‘orderby’ => ‘ID’, ‘order’ => ‘ASC’, ); $terms = get_the_terms($post->id, ‘category’, $args); $count = count( $terms ); if ( $count > 0 ) { foreach ( $terms […]

Sort results without WP_QUERY?

I am new to coding a WP_QUERY and I tried a few things with it but it doesn’t seem to work. Right now (you can see the page here: http://boomerang.mannydesigns.co/artistes/parcourir/musique/ ) I need to reorganize the ordering of these artists by a custom field I added (with ACF) name exclusif which is a selection field […]

Url to archive page for custom post type

I made a custom post type , and an archive page for the post type. I don’t know if there is a url where I can access this archive page? I would like to have a page where all the “posts” (products) for this archive is listed. But they don’t need to be organized into […]

Urls in Custom Post Type work for Terms but not for its Taxonomies

I have created 12 taxonomies for a custom post type and a few terms. On creating new post it looks like this and that is perfect – Taxonomies with terms I have: archive page – url is sitename/kalendar – working ok single page – url is sitename/kalendar/title – working ok taxonomy page – url should […]

Registered Post Type Isn't Showing in Admin Menu

I have a custom function to make posts hierarchical by registering a post type in my functions.php like this: register_post_type( ‘post’, array( ‘hierarchical’ => true ) ); After uploading, the posts item from admin menu just disappears. Why is this happening?