Skip to content

Instantly share code, notes, and snippets.

View shahadul878's full-sized avatar
🎯
Focusing

H M SHAHADUL ISLAM shahadul878

🎯
Focusing
View GitHub Profile
@shahadul878
shahadul878 / install-wp.sh
Created January 29, 2024 10:36
This Bash script automates the setup of a WordPress development environment. It creates a new WordPress installation with a specified site name, database credentials, and installs essential plugins. The script creates a "mu-plugins" directory, initializes Composer for dependency management, and includes a sample plugin for debugging. The site is…
#!/bin/bash
# Function to display an error message and exit
function display_error() {
echo "Error: $1"
exit 1
}
# Function to prompt for input with a given message
function prompt_input() {
<?php
function recursiveRename($directory, $search, $replace) {
// Get the list of files and directories in the current directory
$contents = scandir($directory);
if ($contents === false) {
return; // Unable to open directory, return
}
foreach ($contents as $item) {
@shahadul878
shahadul878 / Fast Stone Key
Created April 19, 2022 13:28
Fast Stone Key
100% work for any version..
--- Activation Key ---
Name : KARAN PC
Serial :
AXOQM-RDMFS-ZMNOU-QTIBC
AXMQU-RFMKG-LJJAZ-JMXHF
AXNQH-RSMOQ-RIJJQ-YQXHE
AXOQV-RYMDN-XLEHP-AEGEJ
AXZQT-RGMUD-LINUP-ZTEGJ
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Skin_Simple extends Skin_Base {
/**
* Skin base constructor.
*
* Initializing the skin base class by setting parent widget and registering
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shahadul878
shahadul878 / functions.php
Last active February 4, 2021 18:15
change add to cart message woocommerce
/**
* Custom Added to your Cart Message
*/
add_filter( 'wc_add_to_cart_message_html', 'shahadul878_custom_added_to_cart_message' );
function shahadul878_custom_added_to_cart_message() {
$message = 'You cool product is in the cart!' ;
@shahadul878
shahadul878 / functions.php
Created February 4, 2021 11:51
Add <Sup> Tag On woocommerce
/***
* Add Supscript On Price
*
***/
if ( ! function_exists( 'apsape_add_sup_decimals_to_pricing' ) ) {
function apsape_add_sup_decimals_to_pricing ( $price ) {
if ( ! is_admin() ) { // Check that we're not in the admin
$price = strip_tags( $price );
$price_exploded = explode( '&ndash;' , $price );
@shahadul878
shahadul878 / functions.php
Last active November 18, 2020 17:44
Woo commerce Product Category Page Product Show
/**
* Change number of products that are displayed per page (category page)
*/
add_action('pre_get_posts','sanji_woocommerce_archive',9999);
function sanji_woocommerce_archive($query) {
if (!is_admin() && $query->is_main_query() && is_shop() || is_woocommerce() || is_product_category() || is_product_tag()) {
$query->set( 'posts_per_page', '12' );
}
@shahadul878
shahadul878 / google-fonts.php
Created March 25, 2017 08:34 — 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'];
@shahadul878
shahadul878 / shortcode.php
Last active March 21, 2017 17:29
WordPress Short Code
function add_your_own_function_name( $atts, $content = null ) {
extract( shortcode_atts( array(
'text' => '',
'type' => ''
), $atts ) );
return '<div class="alert alert-'.esc_attr($type).'" role="alert">'.esc_attr($text).'</div>
';