Articles of type

Archive Page for Custom Post Type is not Working

I have registered a custom post type “tutorials” with the following snippet. <?php /* Template Name: Tutorial Archive */ get_header(); ?> <div id="content"> <div class="archive-page"> <?php $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query('showposts=8&post_type=tutorials'.'&paged='.$paged); if ($wp_query->have_posts()) : ?> <h1>Tutorials Archive</h1> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <article class="posts" id="post-<?php the_ID(); ?>"> <h2><a […]

Post Type Label Name

i’ve just created a new post type. It’s name is Academias so the first menu option is Academias as well. But I would like to change it to something like See All Academias (just an example), is that possible?

Unattaching images from a post

I currently have a custom post type in a theme I’m developing which will be used for portfolio items. So far, I have implemented functionality that allows images to be attached to a portfolio post. I now need the best way to go about detaching images from a post: My code currently is: $images =& […]

.current-menu-item class on custom post type children pages – again?

There is the situation. I have created the custom post type – products withfuncionality like pages – I have to create hierarchy. f.e: Chairs: Oak Chair Nice Chair The weird thing happens with wp_nav_menu(). When I open the first level page Chairs and display all the Chairs childrens in theme, the nav menu for the […]

Custom Post Type Pagination Doesn't Work in WordPress 3.4

I have a problem when using WordPress 3.4. My “Products” custom post type pagination doesn’t work. Here is the code I use $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $loop = new WP_Query( array( ‘post_type’ => ‘products’, ‘posts_per_page’ => PER_PAGE_DEFAULT, ‘paged’=>$paged ) ); That code works well in previous WP version (WordPress 3.3.2) but not […]

Remove custom posts that match taxonomy value

I have a custom post type ‘listings’ and within that a taxonomy called ‘status’ where the posts are either ‘standard’ or ‘premium’. What SQL query (or other method), could I use to delete all custom posts where the taxonomy ‘status’ has the value ‘standard’ ? Thank you.

Use plugin or custom post type for game score functionality

The last couple of days I’ve been working on a plug-in that adds the functionality of keeping scores from a paintball game. When I manage to finish it I want to present players with a form so they can add in stuff like: hits, deaths, wins, losses, location, role and date. That goes to a […]

Actions according to image type and size

I want to do some actions according to image type and size, but the script I’m using is kind of heavy and is skyrocketing my wait time (first byte) from 5 to even 40 seconds (usually it’s bellow a second). $image_data = wp_get_attachment_image_src( get_post_thumbnail_id($post -> ID), ‘full’); $animated = is_animated_gif($image_data[0]); $width = $image_data[1]; if($animated){ $size […]

Custom post type permalinks breaking due to 3.1 bug fix

So I just updated a site to 3.1 that uses several custom post types. When I had made the site I had not noticed at the time the $post_type parameter for register_post_type has to be in all lowercase letters! ( it was not well written in the codex but now it is bold). My […]

user contributed content as custom post types

We are looking into creating a solution that allows user to contribute media files by filling out a form (without access to the admin) and have it ןד created as a custom post type. The files will be either YouTube Movies, PowerPoint Files etc. Is that possible at all? Do you know any example of […]