Skip to content

Instantly share code, notes, and snippets.

View kutoi94's full-sized avatar
🏠
Working from home

Luan DANG kutoi94

🏠
Working from home
View GitHub Profile
@kutoi94
kutoi94 / flexible-by-meta-box
Last active June 9, 2019 00:05
Flexible Field like ACF use Meta Box Plugin
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',
'id' => 'flexible-field-example',
'post_types' => array(
0 => 'page',
),
'context' => 'normal',
'priority' => 'high',
@kutoi94
kutoi94 / Meta Box Plugin
Created July 12, 2019 03:48
Create custom field in product details page by meta box plugin
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',
'priority' => 'high',
@kutoi94
kutoi94 / Meta Box Plugin
Created July 12, 2019 03:45
Use Meta Box to build the product detail page
<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">
add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
function your_prefix_register_meta_boxes( $meta_boxes ) {
$meta_boxes[] = array (
'title' => 'Related Post',
'id' => 'related-post',
'post_types' => array(
0 => 'post',
),
'context' => 'normal',
'priority' => 'high',

Keybase proof

I hereby claim:

  • I am kutoi94 on github.
  • I am kutoi94 (https://keybase.io/kutoi94) on keybase.
  • I have a public key ASD6MAs61YviKPWdwfqqYCKIudkQUgX6QH0Ozyk1CTJsSAo

To claim this, I am signing this object:

@kutoi94
kutoi94 / page-account.php
Last active September 14, 2019 07:30
Page My Account create with MB User Profile Plugin
<?php
/*
* Template Name: My Account
*/
?>
<?php
if ( !is_user_logged_in() ) {
auth_redirect();
<?php
/*
* Template Name: Publish Post
*/
?>
<?php
if ( !is_user_logged_in() ) {
auth_redirect();
@kutoi94
kutoi94 / page-account.php
Created September 16, 2019 02:12
Page account create by bootstrap and MB Plugin
<?php
/*
* Template Name: My Account
*/
?>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<?php
@kutoi94
kutoi94 / publish-post.php
Created September 16, 2019 03:03
Full source code publish-post.php
<?php
/*
* Template Name: Publish Post
*/
if ( !is_user_logged_in() ) {
auth_redirect();
}