Skip to content

Instantly share code, notes, and snippets.

@danyj
danyj / thz_disable_gutenberg.php
Created October 25, 2018 09:15
Disable Gutenberg globally or for specific post types for WordPress 5.0 and UP
<?php
/*
* Disable Gutenberg globally
* use this if you prefer one-liner
* add_filter('use_block_editor_for_post', '__return_false');
*/
function _thz_filter_disable_block_editor(){
return false;
}
add_filter( 'use_block_editor_for_post', '_thz_filter_disable_block_editor' );
@itzikbenh
itzikbenh / home.php
Last active April 5, 2020 09:30
Very simple infinite scroll in WordPress.
//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>
@spigotdesign
spigotdesign / get-svg.php
Created January 25, 2016 21:29
WordPress get SVG file contents
<?php echo file_get_contents( get_stylesheet_directory_uri() . '/img/icons/your-logo-file.svg' ); ?>
@radiovisual
radiovisual / custom-wordpress-gallery-output.php
Last active September 27, 2022 04:44
Create custom wordpress gallery output
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 29, 2024 03:40
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@hofmannsven
hofmannsven / README.md
Last active October 22, 2023 12:32
This is my global Git/Bash userprofile. All files are named with a dot at the beginning (e.g. ~/.bash_profile, ~/.git-completion.bash, ~/.git-prompt.sh, ~/.gitconfig, ~/.gitignore_global)
@terkel
terkel / _decimal.scss
Last active June 17, 2024 14:07
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0