background preloader

Custom post types

Facebook Twitter

Change Number of Posts Shown for Custom Post Type. When displaying an Archive Page for a Custom Post Type, have you ever wanted to increase the number of posts shown?

Change Number of Posts Shown for Custom Post Type

Normally, the Archive Page is treated like any other index page and uses the Setting -> Reading value for “Blog pages show at most” value. So if you have a custom template for “testimonials” for example and instead of the standard setting of 10 you want to show 20 items, here’s how to filter that: How it works The pre_get_posts action is signaled just before the WP_Query object performs it’s query. This gives you a chance to modify things before the query is run. The test checks to see if the query being run is a “main query”, meaning it’s the main query being run to display the archive page.

The final method call to $query->set() simply sets the number of posts that you want your archive to display, thus overriding whatever value the standard setting has. Get Values From A Relationship Field. In this quick tutorial I will show you how to get values from a Pods’ relationship field, or a bi-directional relationship field between two different post types.

Get Values From A Relationship Field

There are many possible types of relationship fields, but one of the most common and powerful uses for them is to relate one type of post type to another. With these types of relationships posts in one post type (custom or not) become values for a field in another post type. UPDATE: March 19, 2014- The code in this article assumes the related post is a custom post type, not an Advanced Content Type. I have added a new section and example code for use when the related post is an Advanced Content Type at the end of this article. I am not going to cover how to create relationship fields or bi-directional fields as this is short tutorial and there are detailed instructions on creating relationship fields, including bi-directional relationships on the page for relationship fields.

$pod = pods( 'pod_name', get_the_id() ); if ( ! Creating, managing, and displaying custom post types using the Pods Framework plugin for WordPress. Plugin API/Filter Reference/attachment fields to edit. Plugin API/Filter Reference/attachment fields to edit Description The "attachment_fields_to_edit" filter is used to filter the array of attachment fields to that are displayed when editing an attachment.

Plugin API/Filter Reference/attachment fields to edit

Usage When the 'attachment_fields_to_edit' filter is called, it is passed two arguments. The first argument is an associative array describing the fields to be diplayed. Filters - How can I remove the image attachment ALT field?

Sort order

Custom Content Portfolio. Support Questions: The official support forum for this plugin is located at Theme Hybrid.

Custom Content Portfolio

Custom Content Portfolio is a portfolio management plugin for creative people such as artists, photographers, and Web designers to showcase their work. Just like what bbPress is doing for forums and BuddyPress is doing for social networks, Custom Content Portfolio is doing for portfolios. This plugin was created because of the rising need from users who are downloading WordPress themes with portfolio management built in (not a good idea for content portability). I wanted users to be able to switch themes without losing their content.

This will also allow any theme developer to build a theme on top of this plugin. Pods Framework. Use WordPress Custom Post Types to Add Events to Your Site. One of the more interesting (and useful) features in WordPress is custom post types.

Use WordPress Custom Post Types to Add Events to Your Site

As the name suggests, WordPress allows you to define your own post types which are treated just like existing ones (i.e. Posts and Pages). For instance, I was recently developing a site which needed to create and publish events. After digging around, I found an excellent article by Noel Tock on how to use custom post types to create events. Even though Noel did a great job explaining the concept and laying out the approach, he did leave a couple of things out.

How Should Events Work? Before diving into implementation details, let’s first talk about requirements. Well, first of all, there would be a new category of things in WordPress called Events: Second, there would be an easy way to see what Events have been created (like Posts or Pages): And of course there would be an easy way to add a new event and specify event details like date and location: Ok, But How Do We Do It? 1. 2. Adding Sortable Columns 3. 4. WordPress Custom Post types parent/child relationship. WordPress Custom Post Types using Types Plugin. What is a WordPress Custom Post Type?

WordPress Custom Post Types using Types Plugin

WordPress custom post types let you add your own data types to the WordPress admin. Out-of-the-box, WordPress comes with pages and posts. If you want to display other types, such as products, testimonials, projects and anything else, the best way is to setup custom post types. This way, different types of content are organized under different menus. You can also control user-access for different types, allowing better management of your site. Support » Query posts from custom post type, and from same category as current page. Hello!

Support » Query posts from custom post type, and from same category as current page

I'm working on a clients web site, a record label, where I'm struggling to achieve the following: I have created a custom post type for artists, and one for albums. On both of them I have enabled categories as taxonomies. Let's say I then add an artist called "Little David" and assign him to the Little David Category. Then I add the album "Little David Live", and assign the album to the Little David Category as well. So, now we have both an artist and an album in the same category (Little David) When on the artist page, I would like to query all albums from that artist. Using WordPress custom post types and taxonomies - Kino Creative. Custom post types and taxonomies are a very powerful feature introduced in WordPress 3.0 that allow you to organise your site content much more effectively and provide a more usable interface in the back end of the site.

Using WordPress custom post types and taxonomies - Kino Creative

We been utilising these features in all our recent website builds and will be using the recently completed AMV Live Music website as an example. AMV is a booking agent providing live musical entertainment for all occasions, focusing on the north east of England and Newcastle. We felt our website design worked well for the purpose, we just needed a good way of displaying the bands and making them easy to manipulate through the content management system. We used custom post types to categorise the artists featured on the site as well as customise the view in the dashboard to make adding and managing artists that much easier.