• Skip to main content
  • Skip to primary sidebar

WordPress, Genesis Framework and Storefront customization tutorials

  • Archive
    • Free
    • Premium
  • Blog
  • About
  • Contact
  • Newsletter
  • Login
Home » Free » Page 3

Free

How to fix WP-CLI Error establishing database connection in LocalWP

Create file named info.php in your WordPress root folder with the following PHP function:

<?php phpinfo(); ?>

Check the http://yourdomain.com/info.php details and search for pdo_mysql.default_socket. Here You will find the value that You need>

Change your DB_HOST value in the wp-config.php file from localhost to

/** MySQL hostname */
define( 'DB_HOST', 'localhost:/Users/YOUR_MACOS_USERNAME/Library/Application Support/Local/run/VALUE_FROM_PHP_INI/mysql/mysqld.sock'

YOUR_MACOS_USERNAME – whatever your username that you log into your computer with.
VALUE_FROM_PHP_INI – Click the (i) icon next to the version of PHP in Local. Once the php info page loads in your browser, search the page for “Loaded Configuration File”. You should see something like /Users/xxx/Library/Application Support/Local/run/JVTSp1q91/conf/php/php.ini. Grab the random set of characters between “run/” and “/conf”. In my example, JVTSp1q91.

Filed Under: Free

Compile SASS and build JS with Webpack

If You’ve tried SASS before You don’t want to write a single line of CSS anymore. Webpack is an awesome tool that builds and minify the JavaScipt and CSS files.

How to use Webpack with SASS Loader?

Open the terminal at the project folder

Step 1 – Initialize package.json

npm init -y

Step 2 – Install the following packages:

  • Webpack
  • Webpack-CLI
  • Sass Loader
  • Node Sass
npm install --save-dev webpack webpack-cli sass-loader node-sass

Your package.json going to be look like this

It is going to be generated, so You don’t need to copy the content.

Step 3 – Create a file named webpack.config.js

Step 4 – Run webpack and watch for changes

npx webpack --watch

Filed Under: Free Tagged With: Webpack

Webpack basic config

webpack.config.js

Filed Under: Free

Display WooCommerce Product Category Subtitle

Filed Under: Free Tagged With: WooCommerce

How to add Google Maps API Key to WordPress

Let’s go to the Google Cloud Platform

You have to add credit or debit card to use the Google Maps platform.

Create a new project

Enable APIs and Services

Search for these 3 APIs

  • Maps JavaScript API
  • Places API
  • Geocoding API

Create the credentials

  • Application restrictions must be HTTP referrers (web sites)
  • Website restrictions is your website url
  • API restrictions – select the above mentioned 3 API

and in the end just add the following snippet to your functions.php with your API key:

Filed Under: Free

Install WordPress Plugins with Composer from Command Line

Create a file named composer.json in your theme folder. Copy and paste the following json snippet.

Open the terminal in the theme folder and type:

composer update

WordPress Packagist

Filed Under: Free

Remove product content based on category

Filed Under: Free Tagged With: WooCommerce

Get Current Shipping Method WooCommerce

Filed Under: Free Tagged With: WooCommerce

Update Cart on Quantity Change in WooCommerce

#1 Hide update cart button

.woocommerce button[name="update_cart"],
.woocommerce input[name="update_cart"] {
	display: none;
}

#2 Create a file named update-cart.js

jQuery( function( $ ) {
	$('.woocommerce').on('change', 'input.qty', function(){
		$("[name='update_cart']").trigger("click");
	});
});

#3 Enqueue it only on cart and checkout page

// CART
function add_custom_scripts() {
    if( is_cart() ) {
        wp_enqueue_script( 'update-cart-js', get_stylesheet_directory_uri() . '/assets/js/update-cart.js'      );
}
add_action( 'wp_enqueue_scripts', 'add_custom_scripts' );

Filed Under: Free

Order upcoming events by ACF datepicker

Filed Under: Free

Minimum cart amount for specific category in WooCommerce

Filed Under: Free Tagged With: WooCommerce

Disable Link to Single Product in WooCommerce Archive

Filed Under: Free

Hide all warnings in WP admin

Filed Under: Free

Attach file to WooCommerce order emails

Filed Under: Free Tagged With: WooCommerce

Check if current product belongs to specific category on single product page

Filed Under: Free Tagged With: WooCommerce

How to enqueue JavaScript Asynchronously in WordPress?

functions.php

Filed Under: Free Tagged With: JavaScript

How to Add Default Country to WooCommerce Checkout?

Filed Under: Free Tagged With: WooCommerce

Display WooCommerce Products with ACF Repeater Field and Post Object

Filed Under: Free Tagged With: WooCommerce

Hide If Empty WooCommerce Notification on Cart Page

Filed Under: Free Tagged With: JavaScript

Change order status to completed after successful payment in WooCommerce

Filed Under: Free Tagged With: WooCommerce

  • « Go to Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Interim pages omitted …
  • Go to page 17
  • Go to Next Page »

Primary Sidebar

Gabor Flamich

Hi! I'm Gabor.
I write tutorials on WordPress and WooCommerce.

MacBook

12 Essential Snippets for Genesis Developers

Subscribe to my Newsletter to view my basic collection of Genesis snippets that I use for my projects!

Sign Up for Free
  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube
UpdraftPlus Premium

Tags

ACF Ajax Analytics API Bootstrap Breadcrumb category CPT CSS fetch Genesis Google Maps Gutenberg HTML Isotope JavaScript jQuery loop Map Menu Parallax PHP SASS SEO SQL Storefront SVG tab tag manager tags Taxonomy Tool upsell Webpack Wholesale WooCommerce WordPress WPML

Disclosure: Some of the links in this site are affiliate links. I will be paid a commission if you use this link to make a purchase.

  • Privacy Policy / Terms of Service
© 2023 WP Flames - All Right Reserved