Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Moving bits and bytes around the globe

Niels Lange nielslange

👨‍💻
Moving bits and bytes around the globe
View GitHub Profile
@hafizrahman
hafizrahman / add-gutenberg-class.php
Last active Apr 10, 2019
WordPress: Add body class (for single post template) or post class (for blog/archive pages) "made-with-gutenberg" for posts/pages created with Gutenberg editor.
View add-gutenberg-class.php
// 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' );
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active Nov 12, 2020
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro
View flywheel-local-xdebug-vscode.md

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@lirantal
lirantal / terminal-with-powerline.sh
Last active Mar 24, 2020
Hyper terminal + Powerline 9k terminal theme for oh-my-zsh
View terminal-with-powerline.sh
# 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
@itzikbenh
itzikbenh / home.php
Last active Apr 5, 2020
Very simple infinite scroll in WordPress.
View home.php
//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>
View acf-sidebar-genesis-full.php
<?php
//* Single Portfolio
//* Enlever sidebar classique
remove_action( 'genesis_sidebar', 'genesis_do_sidebar');
add_action( 'genesis_sidebar', 'gn_sidebar');
function gn_sidebar() {
global $post;
//** check ACF
@nielslange
nielslange / .htaccess
Last active Mar 28, 2019 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#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/
@ScottPhillips
ScottPhillips / .htaccess
Created Feb 2, 2012
Common .htaccess Redirects
View .htaccess
#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/
You can’t perform that action at this time.