Skip to content

Instantly share code, notes, and snippets.

View hasanTheBest's full-sized avatar

hasanTheBest

View GitHub Profile
1. In functions.php file
=========================
if(condition){
wp_enqueue_script( 'handler', 'path', array(), 'version', boolean );
$ajax_url = admin_url('admin-ajax.php');
wp_localize_script('handler', 'object_name', array('data_1', => 'value_1') );
}
$post_id = 0;
if ( isset( $_REQUEST['post'] ) || isset( $_REQUEST['post_ID'] ) ) {
$post_id = empty( $_REQUEST['post_ID'] ) ? $_REQUEST['post'] : $_REQUEST['post_ID'];
}
@hasanTheBest
hasanTheBest / kirki-font-awesome.txt
Last active February 13, 2019 06:00
Add font awesome field for the WordPress customizer framework kirki
Kirki::add_field( 'gangster_demo', array(
'type' => 'fontawesome',
'settings' => 'fontawesome_setting',
'label' => esc_attr__( 'Font Awesome Control', 'kirki' ),
'description' => esc_attr__( 'Description Here.', 'kirki' ),
'section' => 'left_section',
'default' => 'bath',
) );
@hasanTheBest
hasanTheBest / BS4 breakpoints
Created May 10, 2018 14:15
min-width for mq-w() and max-height for mq-h() are default value. We can use number [320px], variable[$md] or operator[ $md - .02 ] as parameter of mq-w() or mq-h(). If we want explicit max-width and min-height for mq-w() and mq-h() respectively, we need to set value [$limit : max or min] as second parameter of that mixin.]
### breakpoints(xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px) ###
# Variables
$xs: 0px;
$sm: 576px;
$md: 768px;
$lg: 992px;
$xl: 1200px;
# Width