Skip to content

Instantly share code, notes, and snippets.

View humayunahmed8's full-sized avatar
🤡
code fool

Humayun Ahmed humayunahmed8

🤡
code fool
View GitHub Profile
@jonschr
jonschr / gist:6bc52166db037e880772
Last active April 5, 2023 05:09
Conditional logic with select2 (addon for the Beautiful taxonomy filters plugin)
jQuery(document).ready(function($) {
/**
* If the value is preselected (runs when the the doc is ready)
*/
// get the starting value of the field; empty means no selection is made and conditional fields should hide by default
var startingval = $('select#select-job-industry').val();
if ( startingval == '' ) {
@raselahmed7
raselahmed7 / google-fonts.php
Last active November 11, 2022 10:22
How to call google fonts from theme option in best way
<?php
$frozen_body_font_get = cs_get_option('frozen_body_font');
$frozen_heading_font_get = cs_get_option('frozen_headding_font');
function frozen_crazycafe_body_gf_url() {
$font_url = '';
$frozen_body_font_get = cs_get_option('frozen_body_font');
if(array_key_exists('family', $frozen_body_font_get)) {
$frozen_body_font_get_family = $frozen_body_font_get['family'];
@ImtiazEpu
ImtiazEpu / Old Codestar framework documentation.md
Last active August 18, 2022 09:41
Old Codestar framework documentation

Codestar Framework

A Lightweight and easy-to-use WordPress Options Framework. It is a free framework for building theme options. Save your time!

Screenshot

Codestar Framework Screenshot

Read the documentation for details documentation

Installation

Use WordPress default function to get next and previous post title with permalink something like this:
<?php // FOR PREVIOUS POST
$prev_post = get_previous_post();
$id = $prev_post->ID ;
$permalink = get_permalink( $id );
?>
<?php // FOR NEXT POST
$next_post = get_next_post();
$nid = $next_post->ID ;
@humayunahmed8
humayunahmed8 / json-async-await.html
Last active April 26, 2021 09:50
JSON Async and Await
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Async and Await</title>
</head>
<body>
@humayunahmed8
humayunahmed8 / remove_checkout_fields.php
Created October 27, 2020 11:14 — forked from cryptexvinci/remove_checkout_fields.php
Remove fields from WooCommerce checkout page.
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);