Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorThanks for sharing your solution ๐
March 10, 2022 at 9:15 PM in reply to: โ Change color style for posts which have a "CUSTOM taxonomy" #34457Long Nguyen
ModeratorHi,
You can change the code to get the term meta
$categories = get_the_category(); $background_color = get_term_meta( $categories[0]->term_id, 'background_color_taxonomy', true );to this one
$term_id = get_queried_object_id(); $background_color = rwmb_meta( 'background_color_taxonomy', ['object_type' => 'term'], $term_id );refer to the documentation https://docs.metabox.io/extensions/mb-term-meta/#getting-field-value
Long Nguyen
ModeratorHi,
Please follow this topic to troubleshoot the issue https://support.metabox.io/topic/js-error-on-console-log-google-maps/
Long Nguyen
ModeratorHi,
Can you please deactivate all plugins except Meta Box, MB extensions and switch to the standard theme of WordPress then recheck this issue?
Some screenshots on the Console tab of the developer tool of the browser would be appreciated.Long Nguyen
ModeratorHi Cees,
Using the filter mime type will work for all file extensions, refer to the topic
https://support.metabox.io/topic/how-to-upload-vcf-file-to-custom-post-type-custom-field-upload-file/
https://wordpress.org/support/topic/allow-gpx-file-upload-fails/Long Nguyen
ModeratorHi,
No, the validation callback only accepts 4 parameters. You cannot add your own parameters to pass the multiple inputs.
Long Nguyen
ModeratorThanks for sharing your solution.
March 10, 2022 at 8:35 AM in reply to: How do I populate a relationship value based on the related post they select #34440Long Nguyen
ModeratorHi,
The relationship supports the bidirectional connection feature, which means when you select a connected post when editing a user and save. You go to edit that post and the relation box also displays the user connected.
But the field
postonly supports displaying connected posts from that user only. When you edit the post, you do not see anything like the relationship.You can also create a query to show related posts with the field
postas well.March 9, 2022 at 10:24 PM in reply to: โ How to upload vcf file to custom post type custom field upload file #34437Long Nguyen
ModeratorHi Leo,
Using your code to enable uploading a vcf file on my local site works as well, screen record https://monosnap.com/file/oJG4T3mNHrW7D3yCUX76m8yRKM046X
Can you please run the code with Code Snippets and re-check the issue?
https://wordpress.org/plugins/code-snippets/Long Nguyen
ModeratorHi,
You can disable the option
Prepended permalink structurein the Advanced tab when creating the CPT to setrewriteparameter tofalse.
https://monosnap.com/file/D0BCecDWnPYvDO5m0EYFuCFGcorZRjLong Nguyen
ModeratorHi Brent,
If you build your template with coding, you can add this code to the template file
$value = rwmb_meta( $field_id ); echo date( 'F j, Y @H:i', $value );If you build your template by using prebuilt blocks (just drag and drop), you can use the helper shortcode to show the time value
[rwmb_meta id="datetime" format="F j, Y @H:i"]Remember to set the
timestamptotrue. Refer to the documentation
https://docs.metabox.io/shortcode/
https://docs.metabox.io/fields/datetime/#template-usageMarch 9, 2022 at 10:02 PM in reply to: โ Checkbox not checking when clicking checked by default #34432Long Nguyen
ModeratorHi,
It looks like there is an issue with the builder. Please try to deactivate all plugins except Meta Box, MB extensions and switch to the standard theme of WordPress then re-check this issue.
Long Nguyen
ModeratorHi,
You can use the WordPress function
get_the_terms()to get list of terms without the HTML included. Then use a for loop to iterate through array of terms and add the term slug/name to the custom<div>tag. For example:{% set term_list = mb.get_the_terms( post.ID, 'thematique' ) %} {% for term in term_list %} <div class="term-item {{ term.slug }}"> {{ term.name }} </div> {% endfor %}Refer to the documentation https://developer.wordpress.org/reference/functions/get_the_terms/
Long Nguyen
ModeratorHi,
If you use the view to create a query to show posts (CPT) so no need to use the repeater of Oxygen, just add the view shortcode to the builder to show posts. Running a PHP function in view and passing the post ID to it is a good way
{{ mb.route_function(post.ID) }}
https://docs.metabox.io/extensions/mb-views/#running-php-functionsLong Nguyen
ModeratorHi,
You should wrap a field in an array, the setting
fieldsis an array of field arrays. Check this code'fields' => [ [ //here 'type' => 'group', 'id' => 'slider', 'name' => 'Slider', 'group_title' => 'Test123', 'clone' => true, 'sort_clone' => true, 'collapsible' => true, 'fields' => [ [ 'id' => 'image', 'name' => 'Image', 'type' => 'file_advanced', 'force_delete' => false, 'max_file_uploads' => 1, 'max_status' => false, ], ], ] ],Read more on the documentation https://docs.metabox.io/creating-meta-boxes/#using-code
-
AuthorPosts