Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi Toni,
Do you mean to use the operator +-*/ in view? Or create a calculator to show on the frontend?
Long Nguyen
ModeratorHi,
The problem comes from the code in the file /wp-content/mu-plugins/sitebase/lib/meta-boxes.php line 2339-2355.
Please register the meta box via the filter rwmb_meta_boxes to show the field in the frontend submission form.
add_filter( 'rwmb_meta_boxes', function() { $meta_boxes[] = array( // ... ); return $meta_boxes; } );Long Nguyen
ModeratorHi,
The function
get_posts()works perfectly if you are going to use a custom query that doesn't need pagination. If you want to show the pagination, please useWP_Queryvia PHP code to show it.Please follow the documentation for more information https://developer.wordpress.org/reference/functions/paginate_links/#user-contributed-notes.
Refer topic: https://support.metabox.io/topic/show-pagination-for-query/
Long Nguyen
ModeratorHi,
To get the post permalink or featured image URL, you can use the built-in functions of WordPress, get all information of the post base on the ID.
https://developer.wordpress.org/reference/functions/get_permalink/
https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/{% set post_link = mb.get_permalink(post.ID ) %} {% set featured_image_url = mb.get_the_post_thumbnail_url(post.ID, 'medium') %} <h3><a href="{{ post_link }}">{{ post.post_title }} </a></h3> <img src="{{ featured_image_url }}">{{ post.post_date | date( 'd/m/Y' ) }}<br />Long Nguyen
ModeratorHi Will,
Query, in simple meaning, is to fetch data from the database and show (or not) on the front end. Registering meta boxes, custom fields are not queries until you show the field's value by calling the helper function rwmb_meta() for example.
Also, I will discuss with the developer team to take a look at queries of Meta Box and reduce any unnecessary queries. Thank you.
Long Nguyen
ModeratorHi,
If you want to use the plugin Meta Box or Meta Box AIO as the library for your custom plugin/addon, please follow these documentations to install it via Composer.
https://docs.metabox.io/composer/
https://docs.metabox.io/extensions/composer/And here is the sample JSON file https://github.com/wpmetabox/library/blob/master/composer/composer.json.
Long Nguyen
ModeratorHi,
WordPress itself does not support to filter the post type of the archive taxonomy in the URL like:
/location/amsterdam/?post_type=post /location/amsterdam/?post_type=eventThis is a rarely case when you use one taxonomy for multiple post types so you have to use the code to show the specific post type of the taxonomy.
You can create another view and set the post type with the code:
- page
{% set args = { post_type: 'page', posts_per_page: 5, tax_query: [ { taxonomy: 'geloofsgemeenschap', field: 'slug', terms: 'ggbreukelen' } ] } %} -
post
{% set args = { post_type: 'post', posts_per_page: 5, tax_query: [ { taxonomy: 'geloofsgemeenschap', field: 'slug', terms: 'ggbreukelen' } ] } %}
See my screen record https://www.loom.com/share/9b0b39943f5f4377bf2fc16765706b33.
Long Nguyen
ModeratorHi,
To trigger a PHP function when clicking a button or any element, we can use the AJAX. These articles would help you to implement AJAX with PHP.
https://www.smashingmagazine.com/2011/10/how-to-use-ajax-in-wordpress/
https://premium.wpmudev.org/blog/using-ajax-with-wordpress/Long Nguyen
ModeratorHi,
Please take a look at the function render_block() under the function set_block_data(),
private function render_block( $attributes = [], $is_preview = false, $post_id = null ) { $this->enqueue_block_assests(); if ( $this->render_callback ) { call_user_func( $this->render_callback, $attributes, $is_preview, $post_id ); return; } if ( file_exists( $this->render_template ) ) { include $this->render_template; } else { locate_template( $this->render_template, true ); } }if the callback is available, it will run the callback and end the function before call the template so it is impossible to run a template inside the callback. But thanks for the idea, I will discuss with the developer team to support this case.
Long Nguyen
ModeratorHi,
Because there are two views that apply the location for Archive so it does not work properly, see https://share.getcloudapp.com/xQuLJGzD.
I've moved to trash all views and keep one view Nieuwsarchief Breukelen, paste the view shortcode to the page Breukelen then it works as well https://single2.stjandedoper-vechtenvenen.nl/breukelen/.
Long Nguyen
ModeratorHi,
Because the relationship action runs before the settings page so it does not get the value from the helper function. You can use the function get_option() to get a field value from the settings page.
'query_args' => array( 'post_parent' => (int) get_option( 'ggbox_settings' )['gg-packages-parent-page'] ),Long Nguyen
ModeratorHi,
This problem is so weird, please follow this guide to know how to create the staging site https://www.wpbeginner.com/wp-tutorials/how-to-create-staging-environment-for-a-wordpress-site/.
Then share the credentials (Admin site and FTP account) via this form https://metabox.io/contact/. I will check it out.
Long Nguyen
ModeratorHi,
Could you please switch to the default theme of WordPress (Twenty Twenty) then check the archive page again?
Long Nguyen
ModeratorHi,
The relationship field settings have a bit different from the regular field settings which are inside the meta box settings https://docs.metabox.io/creating-meta-boxes/. That's why it has the same level as the setting meta box.
'meta_box' => [ //settings ], 'field' => [ //settings ]Understand it correctly, it gets the post type researchtheme and field settings
toto show on the post type networkfromas a custom field.September 6, 2020 at 10:35 PM in reply to: Display image captions in Image Advanced on the back end #21681Long Nguyen
ModeratorHi,
Thanks for the idea, I'm going to create a feature request for the developer team to support showing the images' fields under the thumbnail.
- page
-
AuthorPosts