Skip to content

Instantly share code, notes, and snippets.

View rilwis's full-sized avatar
🙂
Happy and peace when coding

Anh Tran rilwis

🙂
Happy and peace when coding
View GitHub Profile
@rilwis
rilwis / acf-block.php
Created December 7, 2023 05:01 — forked from razaanstha/acf-block.php
ContentEditable - ACF Block
<?php
/**
* Block: Hero
* --------------------------------
* The hero block for all pages.
*/
$block_data = get_fields();
?>
@rilwis
rilwis / function.php
Last active January 31, 2020 09:20 — forked from kutoi94/function.php
How to Build a Hotel Booking Website Using Meta Box (P3) - functions.php
if ( ! get_option( 'rwmb_bookings' ) ) {
add_option( 'rwmb_bookings', array() );
}
add_action( 'rwmb_booking-fields_after_save_post', 'update_bookings_date' );
function update_bookings_date( $post_id ) {
$bookings = get_post_meta( $post_id, 'group_booking', true );
@rilwis
rilwis / single-room.php
Last active September 24, 2023 15:05 — forked from kutoi94/single-room.php
How to Build a Hotel Booking Website Using Meta Box (P3) - Template
<?php get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'single' );
the_post_navigation();
echo do_shortcode("[mb_frontend_form id='booking-fields' post_fields='title,content']");
@rilwis
rilwis / custom.js
Last active January 31, 2020 09:11 — forked from kutoi94/custom.js
How to Build a Hotel Booking Website Using Meta Box (P3)
jQuery( function($) {
setTimeout(function(){
datepicker_reinstall();
console.log(disable_dates);
}, 1000);
function datepicker_reinstall(){
var dateFormat = "yy-mm-dd",
from = $( "#group_booking_check_in" ),
to = $( "#group_booking_check_out" );
<main id="Main">
<div class="page-wrapper">
<div class="container">
<div class="row">
<div id="menuBarleft" class="col-lg-3 col-sm-12">
<div id="navbarNav" class="nav nav-tabs">
<div id="v-pills-tab" class="nav flex-column nav-pills menu-left" role="tablist" aria-orientation="vertical">
<?php $group_values = rwmb_meta( 'faq_tab' );
$count = 0;
if ( ! empty( $group_values ) ) {
@rilwis
rilwis / booking.js
Created November 18, 2019 02:56 — forked from kutoi94/booking.js
Booking Calculation
jQuery( document ).ready( function( $ ) {
$('.group-bookings .add-clone').on('click', function(e){
setTimeout(function(){
var rooms = $('.group-bookings .rwmb-group-clone').length;
$('input#amount').val(rooms);
update_js();
}, 100);
});
<?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
@rilwis
rilwis / publish-post.php
Last active September 20, 2019 03:15 — forked from kutoi94/publish-post.php
Full source code publish-post.php
<?php
/**
* Template Name: Publish Post
*/
if ( !is_user_logged_in() ) {
auth_redirect();
}
$current_user = wp_get_current_user();
get_header();
@rilwis
rilwis / page-account.php
Last active September 20, 2019 03:16 — forked from kutoi94/page-account.php
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
<?php
/**
* Template Name: Publish Post
*/
if ( !is_user_logged_in() ) {
auth_redirect();
}
get_header();
?>
<div class="wrap">