Fancybox loading small white square

You have inserted wrong thumb functions for large fancybox image URLs. <a href=”https://wordpress.stackexchange.com/questions/159324/<?php get_the_post_thumbnail(); ?>” class=”project-img fancybox”></a> This get_the_post_thumbnail() returns an HTML image element but you need URL of image. Your first code should be like this. <?php $args = array( ‘post_type’ => ‘portfolio’ ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) … Read more

Custom post type – change name in sidebar

Use this one. Notice ‘menu_name’ field says Jobs now. // Register Custom Post Type function custom_post_type() { $labels = array( ‘name’ => _x( ‘Jobs’, ‘Post Type General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘job’, ‘Post Type Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Jobs’, ‘text_domain’ ), ‘parent_item_colon’ => __( ‘Parent Item:’, ‘text_domain’ ), ‘all_items’ => … Read more

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

The code you need will vary slightly depending on whether the Conference field is storing a text string (like “Big Ten”) vs. the ID of the Conference post. I’ll include both: Text String Example // place this code inside the loop of your single-team template $conference_name = get_post_meta( get_the_id(), ‘conference’, true ); $conference = get_page_by_title( … Read more

List child categories from parent category on custom taxonomy page

Two things! 1) Don’t use query_posts()! Instead, for situations like this, use the pre_get_posts action to modify the query. 2) I don’t think you actually want to be using a loop here at all (so neither query_posts() nor pre_get_posts or even WP_Query). Rather, I think you’re looking for wp_list_categories. In your template, you’d probably do … Read more

Custom Post Type View Button in Admin Gives 400 Error

I found a solution here: Custom post types, taxonomies, and permalinks TheDeadMedic’s solution worked like a charm. function filter_post_type_link($link, $post) { if ($post->post_type != ‘project’) return $link; if ($cats = get_the_terms($post->ID, ‘project_categories’)) $link = str_replace(‘%project_categories%’, array_pop($cats)->slug, $link); return $link; } add_filter(‘post_type_link’, ‘filter_post_type_link’, 10, 2); This checks to see what Project Categories are associated with the … Read more

WordPress Custom URLs

You can’t do this, at least not in any non-hacky way. You basically want “episodes” to represent 2 different things at the same time, but WP has no way of knowing which is intended for any given path. I guess you could put some logic at the top of your single post template for your … Read more

Has register_post_type() changed for WordPress 4.0

Answering your question literally — no, there had been no major code changes to register_post_type() between 3.9 and 4.0. This is the diff for the changes (from git diff origin/3.9 — src/wp-includes/post.php): function register_post_type( $post_type, $args = array() ) { global $wp_post_types, $wp_rewrite, $wp; @@ -1235,8 +1333,10 @@ function register_post_type( $post_type, $args = array() ) … Read more