Articles of custom post types

Displaying One Custom Post Type's Content On Single Post of Another Custom Post Type

I’m currently building a college football blog and I have 2 custom post types: conference and team. Each conference post type will be a horizontal list consisting of each teams’ logo and will be displayed on every single team post so long as the team is in the respective conference. It will look virtually identical […]

Questions regarding add_meta_box()

Registered a custom post type (xyz) and after that added a meta box using this excellent Tuts+ tutorial, so then I can reduce the usage of ‘Advanced Custom Fields’ where I can (but I love ACF most). But doing so, I came up with some questions: What is the difference between ‘high’ and ‘core’ in […]

Has register_post_type() changed for WordPress 4.0

I know it’s easy to blame the system update rather than user error, but I thought I would double check if anyone else has been running into the same issue! The following register_post_type() has worked through several updates, but very recently on a 4.0 update the custom post type has “disappeared” from the wp-admin sidebar […]

Custom post type – how to name file?

I already have a custom post type working perfectly, except I want to hide single data view. for example www.domain.com/kalendar-radova is a list of things to do, but I dont want www.domain.com/kalendar-radova/wash-the-dishes to be visible. currently filename is archive-kalendar_radova.php my arguments are as follows $args = array( ‘labels’ => array( ‘name’ => ‘Kalendar radova’, ), […]

Price comparison table based on Custom Post Type?

I have created a review site where clients can rate their hosting providers based on various factors, however since the launch, many have asked if it would be possible to create a price comparison table so they could look for provider’s in their price range. I believe the best way to do this will be […]

How do I show my <p> containing my custom field ONLY if there is a set value on that custom field?

I am using the Custom Fields Plugin and have 2 custom fields assigned to my “products” custom post type. Field 1. Price Field 2 Discount Price So this is my code: <div class=”wrapper”> <p>Price: <?php the_field(‘price’); ?></p> </div> “Now this is what I am trying to achieve hypothetically” <div class=”wrapper”> <?php if (the_field(‘discount’); )is set: […]

How can I list custom post type categories of portfolio

this code below lists wordpress categories and works <form action=”<?php bloginfo(‘url’); ?>/” method=”get”> <?php $select = wp_dropdown_categories(‘show_option_none=Select Category&show_count=1&orderby=name&echo=0&selected=6′); $select = preg_replace(“#<select([^>]*)>#”, “<select$1 onchange=’return this.form.submit()’>”, $select); echo $select; ?> <noscript><input type=”submit” value=”View” /></noscript> </form> But I have a custom post type called portfolio and I want to list all categories of portfolio in the same way […]

Function to limit number of custom post types on homepage – TwentyTen

here is the deal… I got hold of this piece of code to change the default post type shown on my TwentyTen child theme’s homepage. It works like a charm when I add this code to the functions.php file, but I would like to also limit the number of posts to 1 (or 2) instead […]

Display custom posts for each category from its custom taxonomy

I’ve looked around at numerous answers and i can do this for the default ‘post’ type like so: $cats = get_categories(); foreach ($cats as $cat) { $cat_id = $cat->term_id; echo “<h2>”.$cat->name.”</h2>”; query_posts(“cat=$cat_id&posts_per_page=100″); if (have_posts()) : while (have_posts()) : the_post(); ?> <a href=”<?php the_permalink();?>”><?php the_title(); ?></a> <?php endwhile; endif; ?> <?php } ?> Im unable to […]

How to limit what Editors see in the admin?

I have a site with a bunch of custom post types, and a few plugins. I would like it so that editors ONLY have access to see posts when they visit a site. Does anyone know of how I can do that? I understand I can add capability functions to the custom post types, but […]