Skip to content

Instantly share code, notes, and snippets.

View rubel306's full-sized avatar
🏠
Working from home

Rubel Hasan rubel306

🏠
Working from home
View GitHub Profile
1.(wp bassic code)
<?php bloginfo('title'); ?> -- For blog title.
<?php bloginfo('description'); ?> -- For Blog Description
<?php bloginfo('charset'); ?> -- For UTF-8 Encoding for pages and feeds
<?php bloginfo('stylesheet_url'); ?> --Displays the primary CSS (usually style.css)
<?php language_attributes(); ?> -- support language from html tag in html: lang="en" .
<?php echo esc_url(get_template_directory_uri()); ?> -- for call theme directory to support images, css, js file
<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
// ===============================================================================================
// -----------------------------------------------------------------------------------------------
// METABOX OPTIONS
// -----------------------------------------------------------------------------------------------
// ===============================================================================================
$options = array();
<?php get_header(); ?>
<?php while( have_posts()): the_post();
if(get_post_meta(get_the_ID(), 'neuron_work_meta', true )){
$work_meta = get_post_meta(get_the_ID(), 'neuron_work_meta', true );
}else{
$work_meta = array();
//create main menu
function custom_menu(){
add_menu_page(
'firstPugin', //page title
'First Plugin', //menu title
'manage_options', //admin level
'first-pugin', //page slug
'custom_admin_view', //callback function
'dashicons-dashboard', //icon url
11, // menu position
function industry_wp_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Footer widgets', 'industry-wp' ),
'id' => 'footer',
'description' => esc_html__( 'Add footer widgets here.', 'industry-wp' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
<?php
/*
Plugin Name: Industry Toolkit
Plugin URI: http://www.bandevs.com
Author: Rubel Hasan
Author URI: http://www.facebook.com/rubel.hasan.3572
Description: This plugin use for only this theme
Version: 1.0
Tag: Industry, Basic, Shortcode generator
<?php
function post_shortcode($atts, $content= null ){
extract(shortcode_atts(array(
'post_type' => "post",
'post_per_page' => 10
), $atts));
$get_post = new WP_Query(array(
'post_type' => 'page',
'post_per_page' => 5
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
/**
* custom_woocommerce_template_loop_add_to_cart
*/
function custom_woocommerce_product_add_to_cart_text() {
global $product;
$product_type = $product->get_type();
// Change number or products per row to 3
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
function loop_columns() {
return 3; // 3 products per row
}
}
// WooCommerce Theme Support
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
add_theme_support( 'woocommerce' );
}