Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
- Make sure your
Local by FlyWheel
WordPress install is a custom install
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
//Just a random file for loading your posts to see that the infinite scroll works. | |
<?php get_header(); ?> | |
<div class="col-md-6 col-md-offset-3"> | |
<div class="post-container"> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<div class="page-header post"> | |
<h1><?php the_title(); ?></h1> | |
<p><?php the_excerpt(); ?></p> | |
</div> |
# Use hyper.is or iTerm2 as terminal emulators | |
# Install ohmyzsh | |
# https://github.com/robbyrussell/oh-my-zsh | |
# Copy over configs from ~/.bash_profile | |
# For example, it may have the nvm setup or any aliases like exa=ls and cat=bat | |
# ~/.hyper.js configuration: | |
copyOnSelect: true |
Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
Local by FlyWheel
WordPress install is a custom install// add class to body class on single post template | |
function themeprefix_body_class_blocks( $classes ) { | |
if ( is_singular() && has_blocks() ) { | |
$classes[] = 'made-with-gutenberg'; | |
} | |
return $classes; | |
} | |
add_filter( 'body_class', 'themeprefix_body_class_blocks' ); | |
<?php | |
// Reset payment method in session | |
add_action('woocommerce_checkout_init', function(){ | |
if( ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || ( defined( 'DOING_AJAX') && DOING_AJAX ) || !WC() || !WC()->session || is_admin() ) { | |
return; | |
} | |
// Get first payment method and store it | |
// Since payment method selection is not persistent, on page load always the first one will be selected |