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
//default add title placeholde text update
function theme_posts_editor_title_placeholder($title){
$post_type = get_post_type();
if($post_type == 'team'){
$title = 'Add Team Member Name';
}
if($post_type == 'pricing'){
$title = 'Add New Pricing';
@rubel306
rubel306 / functions.php
Last active March 16, 2019 16:20
Woocommerce functions
//change woocommerce columns number
function theme_name_woocommerce_loop_shop_columns($nc){
return 3; //number of columns here
}
add_filter("loop_shop_columns", "theme_name_woocommerce_loop_shop_columns");
//exclude/hide/remove woocommerce products from shop page
function wow_post_list_addon(){
vc_map( array(
"name" => __( "Post list", "wowshop" ),
"base" => "post_list",
"class" => "",
"category" => __( "wowshop", "wowshop"),
"params" => array(
array(
"type" => "dropdown",
"heading" => __( "Post type", "wowshop" ),
@rubel306
rubel306 / Woocommerce products per page by dropdown options
Last active November 17, 2018 04:10
show products per page by dropdown options
// WooCommerce shop page show per page drop down
function theme_name_woocommerce_catalog_page_ordering() {
?>
<div class="lbl-cnt">
<?php echo '<span class="lbl">Show</span>' ?>
<form action="" method="POST" name="results" class="fld inline">
<select name="woocommerce-sort-by-columns" id="woocommerce-sort-by-columns" class="sortby" onchange="this.form.submit()">
<?php
/**
* Change several of the breadcrumb defaults
*/
add_filter( 'woocommerce_breadcrumb_defaults', 'woor_woocommerce_breadcrumbs' );
function woor_woocommerce_breadcrumbs() {
return array(
'delimiter' => ' &#47; ',
'wrap_before' => '<div class="breadcrumb">
<div class="container">
<div class="breadcrumb-inner">
// WooCommerce Theme Support
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
add_theme_support( 'woocommerce' );
}
// 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
}
}
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();
<?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
<?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