Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User โ
- Make sure your
Local by FlyWheelWordPress install is a custom install
| <?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 |
| // 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' ); | |
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| # 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 |
| //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> |
| #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/ |