How to use get_post_custom function on the blog page?

The basic problem is that there is no variable $post in your header.php. That variable might exist in the global scope, but your code operates in a function scope of load_template() which was called by get_header(). So you have four options: Import the global variable into your function with the global keyword. global $post; // … Read more

Show Meta Box On Specific Page Template

I typically use CSS and jQuery for this type of thing by hooking admin_head. This should be done client-site as a user has an option to select your template or another one after DOM load. Basically, all you do is check if the value is set for #page_template and toggle show/hide if your template is … Read more

metabox select – frontend display

$change = get_post_meta($post->ID, $key, ‘resume_change_location’, true); From https://developer.wordpress.org/reference/functions/get_post_meta/ get_post_meta returns an array, not an object so you need to use $change[‘index’] The other thing is within your meta box you seem to be saving a string not an array so foreach is going to fail. The below should work… $change = get_post_meta( $post->ID, $key, ‘resume_change_location’, … Read more

Decide Metabox Configurations for All Users

Metabox configuration is stored in the user meta, there are several of them so best way to find all out is to look at the ajax handlers code in \wp-admin\include\ajax-actions.php, therefor you should be able to set it up at user creation time to whatever value you want.

Visual/Text tabs in wp editor Not Showing

Without seeing your code I can’t say whats wrong but here is a working (tested) example of a metabox with an editor inside that has the visual/text tabs. add_action( ‘add_meta_boxes’, function() { add_meta_box(‘html_myid_61_section’, ‘Meta Box Title’, ‘my_custom_meta_function’); }); function my_custom_meta_function( $post ) { $text= get_post_meta($post, ‘my_custom_meta’ , true ); wp_editor( htmlspecialchars_decode($text), ‘mettaabox_ID’, $settings = array(‘textarea_name’=>’inputName’) … Read more

Metabox context for page post type

There is user settings (user metadata) which override the initial meta box order. So it is up to user which meta box he want to display first. User can drag and drop metaboxes and arrange them in any order which he want regardless the order you’ve defined. You can go to user meta table and … Read more