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 / 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 / project-topic.txt
Last active October 3, 2022 05:29
Project Topic
## table of contents:
=====================
1. Basic Php
2. Install WordPress in live server
2.1. WordPress Dashboard Introduction
3. Introduce about IDE & WordPress template hierarchy
4. Introducing about Visual Composer
4.1. Visual Composer academy site
4.2. Use Visual Composer Element/Addons
@humayunahmed8
humayunahmed8 / wordpress-template-hierarchy.php
Created September 12, 2018 19:01
WordPress Template Hierarchy (as of WordPress 4.9)
<?php
/*
WordPress Template Hierarchy (as of WordPress 4.9)
is_404() -------------------------------------------------------------------------------------------------> 404.php
is_search() ----------------------------------------------------------------------------------------------> search.php
is_front_page() ------------------------------------------------------------------------------------------> front-page.php
is_home() ------------------------------------------------------------------------------------------------> home.php
@humayunahmed8
humayunahmed8 / register-sidbar.php
Last active November 11, 2022 10:35
Register sidebar
<?php
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function stock_humayunbd_widgets_init() {
register_sidebar( array(
@humayunahmed8
humayunahmed8 / 1-wp_nav_menu.php
Last active November 11, 2022 10:35
WP Navigation Menus
<?php
// Display Menus on Theme
wp_nav_menu(
array(
'theme_location' => 'header-menu',
'container' => 'div',
'container_class' => 'navbar-collapse collapse align-left',
'menu_class' => 'nav navbar-nav',
@humayunahmed8
humayunahmed8 / custom_logo.php
Created September 13, 2018 07:33
WP Custom Logo
<?php
<div class="logo">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php $logo_id = get_theme_mod('custom_logo'); ?>
<?php if(!empty($logo_id)) : the_custom_logo(); else : ?>
<h3><?php bloginfo( 'name' ); ?></h3>
<?php endif; ?>
@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 / 1-register_custom_post_type.php
Created September 13, 2018 08:13
Register custom post type
<?php
/**
* Short custom post type
*/
function my_theme_custom_post() {
register_post_type( 'cpt',
array(
'labels' => array(
@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
*/