meta-boxes

Wordpress meta boxes - WP tuts tutorial

扶醉桌前 提交于 2019-12-12 03:10:09
问题 I did these tree tutorials to create custom metaboxes. http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-1-intro-and-basic-fields/ http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-2-advanced-fields/ http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-3-extra-fields/ but i don't know how to call values from individual fields. I used this php script $meta = get_post_meta($post->ID, $field['custom_text'], true); echo $meta; but id doesn't work. Does

WordPress Ken Theme Error in Sidebar Editor - “Fatal error: Uncaught Error: Function name must be a string”

一个人想着一个人 提交于 2019-12-11 21:33:10
问题 Hello fellow developers and problem-solvers, I have come across this error in the WordPress dashboard in all of the existing Pages/Posts. Through my experience, I have learned PHP but I am not very experienced when it comes to core php file errors within WordPress itself. Based off similar posts, this could be a PHP version issue with PHP7, yet I'm not entirely sure. Also the theme itself may need to be updated, but I feel there should be a bug fix for this before I would consider updating

Custom Post Type ID Issue - When Querying Other Post Types

主宰稳场 提交于 2019-12-11 18:19:29
问题 I have quite a complex problem to solve which has baffled me for the last day or so. Basically, I have two custom post types 'Sessions' and 'Recipes'. These are showing fine in the backend of WordPress. Attached to the session are several meta boxes, 'Introduction Video', 'Session video', 'Goals', 'Fitness Level' and 'Featured Recipes'. The 'Featured Recipes' meta box is special, as in it queries the WordPress database to get all posts within the 'recipe' custom post type and then use these

How to display Multiple Post Thumbnails plugin custom post thumbnail image in custom template

北城以北 提交于 2019-12-11 15:01:31
问题 I have used wordpress Multiple Post Thumbnails plugin to add custom post meta box image field. if (class_exists('MultiPostThumbnails')) { new MultiPostThumbnails( array( 'label' => 'Homepage Full-Width', 'id' => 'homepage-full-width', 'post_type' => 'post' ) ); } I want to display this new featured image with full size in my site Home page big banner default featured image (http://nimb.ws/YelErQ). Right now theme above post featured image display using following code in theme front-page.php

Updating product post meta data in admin meta box field

若如初见. 提交于 2019-12-11 02:24:10
问题 I am trying to update WooCommerce product meta data using update_post_meta() function, but it does''t work. Here is my code: function woo_add_deal_general_fields_save( $post_id ){ $post_id = (int)$post_id; // tried to convert into integer $woocommerce_textarea = $_POST['_deal_textarea']; if( !empty( $woocommerce_textarea ) ) if ( get_post_meta($post_id, '_deal_textarea', FALSE ) ) { $test= update_post_meta($post_id, '_deal_textarea', $woocommerce_textarea ); } else { add_post_meta($post_id, '

WordPress: How to show a metabox on any admin page?

Deadly 提交于 2019-12-07 08:13:46
问题 I already know how to register metaboxes for Posts, Page, and Custom Post Types, but I would like to register a metabox to be shown on my custom admin page, which is not a post. My plugin has an "Options Page" in the WordPress Admin – I would like to show metaboxes on this very page. Is this possible? If yes, how can this be acheived? I saw in the add_meta_box documentation that one of the possible values for the $post_type parameter is dashboard , however this is not documented anywhere. I

How to create meta box using clone ajax and jquery in wordpress

此生再无相见时 提交于 2019-12-06 16:18:07
问题 I want to create 4 meta-box in a post(at Admin post panel) using clone ajax and jquery. I also need to add "add-more" and "remove" functionalities. 回答1: Hello Try this code I tried this in mine. Its working It creates Four Meta-boxes in Post(admin panel wordpress) add_action( 'add_meta_boxes', 'dynamic_add_custom_box' ); /* Do something with the data entered */ add_action( 'save_post', 'dynamic_save_postdata' ); /* Adds a box to the main column on the Post and Page edit screens */ function

WordPress: How to show a metabox on any admin page?

南楼画角 提交于 2019-12-05 16:13:42
I already know how to register metaboxes for Posts, Page, and Custom Post Types, but I would like to register a metabox to be shown on my custom admin page, which is not a post. My plugin has an " Options Page " in the WordPress Admin – I would like to show metaboxes on this very page. Is this possible? If yes, how can this be acheived? I saw in the add_meta_box documentation that one of the possible values for the $post_type parameter is dashboard , however this is not documented anywhere. I guess it would show the metabox on the WordPress Dashboard (the main admin screen when logging-in),

Editing Custom product tab content in Woocommerce Admin product pages

痴心易碎 提交于 2019-12-05 03:06:21
问题 In WooCommerce, I would like to add custom global product tab just like additional info when a new product is created. I am able to create new tab but cannot update anything on create new product page. I can see it on display page but how to add info through product edit page. I know I can use custom fields but I am looking to have it on product page to allow shop manager or others to fill this additional shipping tab. My Code is add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' )

Saving all values in “multiple select”

感情迁移 提交于 2019-12-02 20:12:19
问题 im having a metabox in wordpress with a mutliple select form. <select name="my_meta_box_select" id="my_meta_box_select" multiple="" style="width:300px; height:400px;"> <option value="red">Red </option> <option value="blue">Blue </option> </select> So far so good, the selected value gets saved and I am able to retrieve it, however I wish for both values to be saved. For example I wish to save both red AND blue and be able to retrieve it from the frontend. Is there any way to achieve this? Are

工具导航Map