looping though custom post types and only return results in a given taxonomy

Check the documentation here: http://codex.wordpress.org/Function_Reference/WP_Query#Taxonomy_Parameters You’ll want to add this to your wp_query: ‘smash-palace’ => ‘smash-palace’ In other words, your new query would look something like: $loop = new WP_Query( array( ‘post_type’ => ‘videos’, ‘artists’ => ‘smash-palace’, ‘post_child’ => 0, ‘posts_per_page’ => 5 ) ); EDIT: I answered this question under the assumption that “Smash … Read more

How to do admin CRUD & Pagination

The way to do CRUD in WordPress for probably 99% of use-cases is to create a Custom Post Type. CPTs will give you CRUD almost for free, then after that you may need to ask a few more questions here about how to do selected additional things, depending on your specific use-case. Good luck!

Category Icon on custom post type

You can use the conditional with in_category. http://codex.wordpress.org/Function_Reference/in_category For example after your loop: <?php if (in_category(‘type’)) { ?> <img src=”https://wordpress.stackexchange.com/questions/15884/<?php echo get_stylesheet_directory_uri();?>/images/custom.gif” alt=”” class=”customicons”/>

Displaying Custom Posts

The problem is that your query is selecting 10 posts per page, but you’re only limiting the view to 5, so you’re losing 5 posts per page. The proper way to change the number of posts per page is to modify the query before the loop: <?php $myquery = wp_parse_args($query_string); $myquery[‘posts_per_page’] = 5; query_posts($myquery); if … Read more

Can’t add text in front of shortcode

Here’s your updated shortcode function which puts output in a variable and returns it. Note that you have to use functions that return data rather than output directly, in this case get_the_post_thumbnail() is used in place of the_post_thumbnail() function cor_etalage_add_shortcode() { $output=”<div id=”etalage”><ul>”; $the_query = new WP_Query(array( ‘post_type’ => array( ‘portfolio’ ) )); while ($the_query->have_posts()) … Read more

custom post type problem

You can create specific single.php for your custom post types, in the form single-customposttype.php (it’s the same with archive.php, see Template Hierarchy) for example single-artist-name.php. Then in those templates you can do pretty much whatever you want. UPDATE Here’s a very simple example of single-artist-name.php : <?php get_header(); ?> <?php if ( have_posts() ) while … Read more