Getting subpage of subpage – Custom posts

The problem is here $subpages = get_pages( array( ‘child_of’ => $pageId, ‘sort_order’ => ‘asc’, ‘sort_column’ => ‘menu_order’) ); ‘child_of’ parameter also queries for the grandchildren along with children. Use the ‘parent’ parameter instead which will only query for the direct children. Once this is done, you’ll use the same code in your foreach again foreach($subpages … Read more

Sorting custom post types in edit.php : Post disappear

The problem is ‘meta_key’ => ‘large_feature’, in your last function, here the “large_feature” is a taxonomy, not a “meta_key”. Infact there is no post in wordpress which has “large_feature” as a “meta_key”. That’s the reason wordpress didn’t display any posts. About ordering by taxonomy terms, wordpress doesn’t allow that like this. You can however customize … Read more

Pagination does not work on Custom Post Type archive while trying to get load more function working

The problem with pagination was fixed by removing the wp_query loop and using the normal loop. <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php endwhile; endif; ?> The problem with the “load more” plugin was fixed by using the right classname to load the items. And change this in the php of the … Read more

custom post template ignored after altering permalinks

Custom post types have a different hierarchy than pages or posts. They’ll use single-{{post_type}}.php and fall back to single.php. Post type archives will use archive-{{post_type}}.php and fall back to archive.php. Your question isn’t super clear, but if you want your custom post type’s singular page to use the page-testimonials.php template, rename it to single-testimonials.php. I … Read more

Making a form for user to add new custom post with custom taxonomies and custom fields

To list the options for a custom taxonomy you need to query the taxonomy terms. To do that you use get_terms() http://codex.wordpress.org/Function_Reference/get_terms // We are assuming color is the name of the taxonomy $colors = get_terms( ‘color’, array( ‘orderby’ => ‘name’, ‘hide_empty’ => 0 )); // Now loop through the colors and spit out the … Read more