Skip to content

Instantly share code, notes, and snippets.

View johnregan3's full-sized avatar

John Regan johnregan3

View GitHub Profile
@johnregan3
johnregan3 / wordpress-transients-tutorial-01.php
Last active December 26, 2018 15:07
WordPress Transients Tutorial, Part 1
<?php
/**
* Get News posts.
*
* This is from a tutorial found here:
* @link https://johnregan3.wordpress.com/how-to-improve-wordpress-load-times-using-transients
*
* @since 1.0.0
* @uses jr3_news_query
*
@johnregan3
johnregan3 / better-related-posts-05.php
Last active December 25, 2018 16:04
WordPress get related posts - 05
@johnregan3
johnregan3 / better-related-posts-04.php
Last active December 25, 2018 16:01
WordPress get related posts - 04
@johnregan3
johnregan3 / related-posts-tutorial-02.php
Last active December 25, 2018 15:59
WordPress Related Posts Tutorial, Part 2
@johnregan3
johnregan3 / related-posts-01.php
Last active December 25, 2018 15:59
WordPress Related Posts Tutorial, Part 1
@johnregan3
johnregan3 / related-posts-tutorial-03.php
Last active December 25, 2018 15:58
WordPress Related Posts Tutorial, Part 3
@johnregan3
johnregan3 / better-related-posts-01.php
Last active December 25, 2018 13:03
WordPress get related posts - 01
@johnregan3
johnregan3 / better-related-posts-final.php
Created December 24, 2018 15:08
WordPress get related posts - Final
@johnregan3
johnregan3 / gutenberg-custom-editor-styles.css
Last active December 21, 2018 22:48
Gutenberg Custom Editor Styles - CSS
/* Custom Editor Styles */
/*
* With some edits, this can be used as a base for your Custom Editor Styles.
* Note that this is for demonstration purposes only, and some elements may not
* be covered here.
*/
/* Approximate the theme width, except for full-width images. */
.wp-block:not( '.editor-block-list__block["data=full"]' ) {
@johnregan3
johnregan3 / full-width-image-theme-support.css
Last active December 19, 2018 05:29
Add Full Width Image Support in a WordPress Theme - CSS
.alignwide {
/* Set these margins to work with your own theme. */
margin-left: -80px;
margin-right: -80px;
max-width: 100vw;
}
.alignfull {
margin-left: calc(-100vw / 2 + 100% / 2);
margin-right: calc(-100vw / 2 + 100% / 2);