Forum Replies Created
-
AuthorPosts
-
February 10, 2022 at 10:43 AM in reply to: Integration between custom post types and page builders #33812
Long Nguyen
ModeratorHi Ori,
- No, I think a page builder should have options to customize any CPT.
2, 3. You can try to use Elementor page builder https://wordpress.org/plugins/elementor/
to customize the typography, color ... of the CPT content.February 10, 2022 at 9:23 AM in reply to: ✅How to display custom fields on cards on LearnPress archive page? #33811Long Nguyen
ModeratorHi,
You can try to use this code to output the
datepickervalue in the loopadd_action( 'learn-press/courses-loop-item-title', function() { $post_id = get_the_ID(); //get post ID in the loop $date_picker = rwmb_meta( 'date_picker_id', '', $post_id ); //get field value based on the post ID echo $date_picker; } );Refer to this documentation https://docs.metabox.io/rwmb-meta/
Long Nguyen
ModeratorHi,
Can you please share the code that creates the CPT on your site? It is possible that there is an issue with the CPT slug or another setting.
Long Nguyen
ModeratorHi,
Can you please share a screen record of the issue? And the code that creates the fields on your site. You can also try again with a fresh WP install to prevent any conflict settings/data.
Long Nguyen
ModeratorHi Dom,
You can use the CSS/JS attribute selector to select the tab with anchor tab ID. Like this
add_filter( 'rwmb_outside_conditions', function( $conditions ) { $conditions['a[href="#tab-backup_site_settings"'] = array( 'hidden' => ['#text', '123'], ); return $conditions; } );Read more on this tutorial https://www.w3schools.com/css/css_attribute_selectors.asp
Long Nguyen
ModeratorHi,
I'm using the field
single_image, and with this code, when you delete the post, the attachment will also be deleted.add_action( 'before_delete_post', 'remove_attachment_with_post', 10 ); function remove_attachment_with_post( $post_id ) { $image_id = get_post_meta( $post_id, 'single_image', true); //1691 image ID if( $image_id ) { wp_delete_attachment( $image_id, true ); } }If you use a field with the setting
'multiple' => truelikefile_advanced, you will need to create a loop to iterate through an array of image IDs. Read more on the documentation https://docs.metabox.io/fields/file-advanced/#template-usageHope that makes sense.
February 9, 2022 at 9:52 PM in reply to: Frontend Form with Age of Person and Custom Fields from Backend #33804Long Nguyen
ModeratorHi Thorsten,
Thank you for reaching out. Let me answer your questions.
-
Yes, it is possible. You can use the extension MB Conditional Logic to show/hide some fields based on a select field. It will work in both frontend and backend. Please read more on the documentation https://docs.metabox.io/extensions/meta-box-conditional-logic/
-
Meta Box does not support a calculation field like that. You have to create some JavaScript code to calculate the value and append the value to a field. You can read more on this series https://metabox.io/create-ota-website-with-meta-box-p1/
-
Same as #2. You need to create your custom code to create a table that shows all events and field value (red, green, yellow) on the frontend.
February 9, 2022 at 9:16 PM in reply to: Blank space when inserting custom fields via Elementors dynamic tags #33801Long Nguyen
ModeratorHi Thomas,
Can you please share some screenshots on your site and the code that creates the custom fields?
February 9, 2022 at 4:03 PM in reply to: Custom post type keeps redirecting me to homepage (301) #33794Long Nguyen
ModeratorHi,
I do not experience any issue with redirection when activating WooCommerce. You can try to contact Woo support to ask for help with this issue.
Long Nguyen
ModeratorHi,
I see there is another question related to your case, please check it here https://support.metabox.io/topic/image-taxonomy/
Long Nguyen
ModeratorHi,
When registering the meta box, you can create a variable
$disabled, set it tofalseby default and check if it is the admin area, change this variable totrueto disable editing. It would be:add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) { $disabled = false; if( is_admin() ) $disabled = true; $meta_boxes[] = [ ... 'fields' => [ [ 'id' => 'text', 'name' => 'Text', 'type' => 'text', 'disabled' => $disabled ], ], ]; return $meta_boxes; } );Long Nguyen
ModeratorHi Migecko,
When creating the CPT or custom taxonomy, please enable the option "Show in nav menus" in the "Advanced" tab to make it available for selection in the menu. Screenshot https://monosnap.com/file/WQTxfzixLuPOIUVfXnf0sIufP6gSbg
If it does not work, you can try to re-save permalink settings (Post name) to flush the cache and re-check the menu item.
Long Nguyen
ModeratorHi,
Meta Box and WordPress do not support deleting field values (post meta) and images uploaded when deleting the post. You can refer to this topic to use a plugin
https://support.metabox.io/topic/remove-unused-images-from-media-library/or this article to use the code to delete images https://www.isitwp.com/remove-featured-image-deleting-post/
Long Nguyen
ModeratorHi Stefano,
You can use the helper function
mb_get_block_field()to get the block field value then use a loop to iterate through an array of images. For example:{% set images = mb.mb_get_block_field( 'image_advanced' ) %} {% for image in images %} <img src="{{ image.full_url }}" /> {% endfor %}Read more on the documentation
https://docs.metabox.io/extensions/mb-blocks/#render_callback
https://docs.metabox.io/fields/image-advanced/#template-usageLong Nguyen
ModeratorHi,
The frontend dashboard does not support showing more any columns for custom fields. You can follow this topic to create your own dashboard with coding https://support.metabox.io/topic/duplicate-dashboard-shortcode/
-
AuthorPosts