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
@humayunahmed8
humayunahmed8 / vc-dropdown-item.php
Created July 22, 2018 05:47 — forked from mahafuz/vc-dropdown-item.php
Dropdown attribute with default value in WPBakery Visual Composer
<?php
/**
* Visual Composer DropDown Item Example in Right Way
* Dropdown attribute with default value in WPBakery Visual Composer
*
* @package VC_Dropdown
* @author Mahfuz <asrmahfuz8@gmail.com>
*/
vc_map(array(
"name" => __( "VC Dropdown", 'textdomain' ),
<?php
/*
Shortcode Documentation
=======================
=> Bootstrap 4 Component
=> Github Documentation
=> Gist Link: https://goo.gl/vuhT4r
TOC:
@humayunahmed8
humayunahmed8 / service-shortcode.php
Created August 2, 2018 05:35
Service box shortcode
<?php
function stock_service_box_shortcode($atts, $content = null){
extract( shortcode_atts( array(
'title' => '',
'desc' => '',
'type' => 1,
'link_to_page' => '',
'external_link' => '',
@humayunahmed8
humayunahmed8 / google-fonts.php
Created August 7, 2018 09:45 — forked from raselahmed7/google-fonts.php
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'];
@humayunahmed8
humayunahmed8 / stock-metabox-options.php
Created September 1, 2018 14:53
Stock Metabox & Options
<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
function stock_humayunbd_theme_shortcode_options($options){
$options = array(); // remove shortcode old options
}
add_filter('cs_shortcode_options', 'stock_humayunbd_theme_shortcode_options');
@humayunahmed8
humayunahmed8 / ampps-mysql-fix.md
Created September 8, 2018 08:02 — forked from irazasyed/ampps-mysql-fix.md
AMPPS MySQL not working, Solution!

AMPPS MySQL not working, Solution!

  1. Open Ampps Application -> MySQL Tab -> Configuration.

  2. In [mysqld] section, add the following line: innodb_force_recovery = 1

  3. Save the file and try starting MySQL

  4. Remove that line which you just added and Save.

@humayunahmed8
humayunahmed8 / shortcode_inside_custom_post_type.php
Last active September 13, 2018 08:07
WordPress Shortcode Inside Custom Post Type
<?php
function post_list_shortcode($atts){
extract( shortcode_atts( array(
'count' => '',
), $atts) );
$q = new WP_Query(
array('posts_per_page' => $count, 'post_type' => 'posttype', 'orderby' => 'menu_order','order' => 'ASC')
);
@humayunahmed8
humayunahmed8 / stock-toolkit.php
Created September 14, 2018 09:54
Theme toolkit files
<?php
/*
Plugin Name: Stock Toolkit
Plugin URI: http://humayunbd.com
Description: Theme shortcode and visual composer addons here.
Version: 1.2
Author: Humayun Ahemed
Author URI: http://humayunbd.com
*/
@humayunahmed8
humayunahmed8 / vc-blocks-load.php
Created September 14, 2018 10:00
Visual Composer blocks load
<?php
// Visual Composer Blocks Load
if(!defined('ABSPATH')) die('-1');
// Class started
class stockVCExtendAddonClass{
function __construct() {
//We safely integrate with VC with this hook
@humayunahmed8
humayunahmed8 / slide-options.php
Last active September 14, 2018 11:18
Metabox and Slide Options for Custom Shortcode Slider.
<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
function stock_theme_page_metabox($options){
$options = array(); // remove old options
// -----------------------------------------
// Slide Options -
// -----------------------------------------