Articles of custom post types

Custom Post Type Field Array parsing

I have a CPT Field named ‘course_location’ as a checkbox with values. When I use $field = get_field_object(‘course_location’); ‘<pre>searchDateArray’; print_r($field); echo ‘</pre>’; Which results in the following array Array ( [key] => field_56056d11c5dd6 [label] => Course Location [name] => course_location [_name] => course_location [type] => checkbox [order_no] => 3 [instructions] => [required] => 0 [id] […]

Display custom meta on page that has been check in custom post type

I have created a custom post type (cpt) and within each post type is a custom meta field. This custom meta field displays all the pages that can ‘checked’. Code to generate the custom meta box: // display list of pages with check box function page_meta_box( $post ) { // Nonce to verify intention later […]

Custom post type not displayed in breadcrumbs on archive page

I created new custom post type and am having problem with displaying the post type name in breadcrumbs. It should display “Home » Study » test study”, but it displays Home » » test study”. Site: CLICK Also, Study (title) should be displayed on the left of breadcrumbs on the site: CLICK On other pages […]

Different videos for different posts

I am a front end developer not with very backend stuff. I just wanted to know that I’m building a website and I need to provide options so that each personality on the website has different videos. What can I use instead of custom field or custom field plugins so that the admin can easily […]

How to call a post's metadata in shortcode.php?

I’m not a terribly advanced WordPress developer, but I can kind of futz my way into a solution most of the time. This time, no such luck: I’m trying to write a shortcode to display a custom post type like a news feed on a page. This custom post type relies heavily on custom metadata […]

Sort custom post types by last name in the backend

I have a custom post type called speakers, where post title is a speakers first- AND last name. I created it with this code: add_action( ‘init’, ‘create_post_type’ ); function create_post_type() { register_post_type( ‘speaker’, array( ‘labels’ => array( ‘name’ => __( ‘Speakers’ ), ‘singular_name’ => __( ‘Speaker’ ) ), ‘public’ => true, ‘has_archive’ => true, ‘supports’ […]

Pages Become “Archive” Instead of Using Page Template

Update: After further inspection it appears that the pages that were effected are being created as “Archive” pages, but there is no archive.php file so they are using index.php. Why would my pages become archive pages when they have custom page-{slug} templates, and how do I fix this? (Earlier. . .) My theme was installed […]

Meta box data is saved but NOT displayed in the meta box text field. Why?

I have a custom post type and I created it using the following code. /* DRAMAS */ register_post_type(‘dramas’, array( ‘label’ => ‘Dramas’, ‘show_ui’ => true, ‘supports’ => array(‘title’, ‘thumbnail’, ‘custom-fields’, ‘description’), ‘labels’ => array ( ‘name’ => ‘Dramas’, ‘singular_name’ => ‘Drama’, ‘menu_name’ => ‘Dramas’ ), ) ); Following code for the meta box mark up […]

Custom Post Type with Configurable Sidebar via ACF

I am using a custom post type (CPT) trainings on one of my client’s sites. I’ve also added a CPT called sidebars, which can get linked into trainings or pages via the “relation” field type. To get an overview over all trainings, I’ve created a separate template “tpl-trainings.php” and added an “overview”-page, which in turn […]

Revert to previous dropdown options after change

I have two dropdowns (which are using Chosen.js). The second dropdown displays custom categories: <script type=”text/javascript”> jQuery(document).ready(function($) { $(‘select[name=”post_type”]’).change(function (event) { if ($(‘select[name=”post_type”]’).val() === ‘test’) { $(‘select[name=”second_dropwdown”]’).html(“<option>Sorry, no options</option>”); $(‘#second_dropwdown’).prop(‘disabled’, true).trigger(‘chosen:updated’); }else{ $(‘#second_dropwdown’).prop(‘disabled’, false).trigger(‘chosen:updated’); } }); }); </script> If I choose “test” in the first dropdown, the second dropdown becomes disabled and shows “Sorry, no […]