This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $field_id = 'related_posts'; | |
| $related_posts = rwmb_meta( $field_id ); | |
| if (isset($related_posts)) { ?> | |
| <div id="relatedPosts" class="related-posts"> | |
| <h3 class="related-posts-headline"><em>You might also like</em></h3> | |
| <div class="related-posts-items jp-related-posts-grid"> | |
| <?php foreach ($related_posts as $related_post) { ?> | |
| <div class="related-post-item"> | |
| <a class="related-post-a" href="<?php echo get_the_permalink($related_post); ?>" title="<?php echo get_the_title($related_post); ?>" rel="nofollow"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="page-wrapper"> | |
| <div class="product-gallery--columns-4 images" data-columns="4"> | |
| <figure class="product-gallery__wrapper"> | |
| <a href="<?php echo get_the_post_thumbnail('full'); ?>"> | |
| <img src="<?php echo get_the_post_thumbnail('full'); ?>" alt="<?php the_title(); ?>"> | |
| </a> | |
| <div class="thumbnails owl-carousel owl-loaded owl-drag"> | |
| <div class="owl-stage-outer"> | |
| <div class="owl-stage"> | |
| <div class="owl-item"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' ); | |
| function your_prefix_register_meta_boxes( $meta_boxes ) { | |
| $meta_boxes[] = array ( | |
| 'title' => 'Car Rental', | |
| 'id' => 'car-rental', | |
| 'post_types' => array( | |
| 0 => 'car-rental', | |
| ), | |
| 'context' => 'normal', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' ); | |
| function your_prefix_register_meta_boxes( $meta_boxes ) { | |
| $meta_boxes[] = array ( | |
| 'title' => 'Flexible Field Example', | |
| 'post_types' => 'page', | |
| 'fields' => array( | |
| array ( | |
| 'id' => 'sections', | |
| 'type' => 'group', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'wp_enqueue_scripts', function() { | |
| wp_dequeue_style( 'font-awesome' ); | |
| wp_dequeue_script( 'jquery-magnificpopup' ); | |
| wp_dequeue_style( 'jquery-magnificpopup' ); | |
| wp_dequeue_script( 'jquery-waypoints' ); | |
| wp_dequeue_script( 'imagesloaded' ); | |
| wp_dequeue_script( 'jquery-throttle' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) { | |
| $meta_boxes[] = array( | |
| 'title' => 'Section Hero', | |
| 'post_types' => 'page', | |
| 'fields' => array( | |
| array( | |
| 'id' => 'hero_title', | |
| 'name' => 'Title', | |
| 'type' => 'text', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $meta_boxes[] = array( | |
| 'title' => __( 'Content blocks' ), | |
| 'post_types' => 'page', | |
| 'fields' => array( | |
| array( | |
| 'id' => 'content-block', | |
| 'type' => 'group', | |
| 'clone' => true, | |
| 'sort_clone' => true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) { | |
| $meta_boxes[] = array( | |
| 'title' => 'Test', | |
| 'fields' => array( | |
| array( | |
| 'type' => 'select_tree', // or checkbox_list | |
| 'id' => 'cb', | |
| 'name' => 'Hierarchical checkboxes', | |
| 'options' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * This demo shows you how to save WYSIWYG field content created by Meta Box plugin as post content. | |
| * | |
| * @link https://metabox.io/docs/how-to-save-wysiwyg-content-as-post-content | |
| */ | |
| add_action( 'init', function () { | |
| // Remove the editor for the post type. | |
| remove_post_type_support( 'post', 'editor' ); // Change 'post' to your custom post type. |