Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / reposition-post-info-conditionally.txt
Created December 3, 2019 01:19
Reposition Post Info Conditionally in Genesis
//* Re-position Post Info Condtionally
add_action( 'genesis_entry_header', 'conditional_reposition' );
function conditional_reposition() {
if ( is_front_page() || is_archive() ) :
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
add_action( 'genesis_entry_footer', 'genesis_post_info', 10 );
@topleague
topleague / particle-js-json-default-code.txt
Created October 21, 2019 03:39
Particle JS Json File Default Code
particlesJS('particlesbg',
{
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
@topleague
topleague / front-page-hero-particle-js-background.php
Last active October 21, 2019 03:28
Full Width Hero Background with ParticleJS Pattern on Front Page
//* Full Width Hero Background with ParticleJS Pattern on Front Page
//* Add Excerpt support to Pages in Genesis (Optional)
add_post_type_support( 'page', 'excerpt' );
//* Display Page Title and Page Excerpt (as Subtitle) after Header
add_action( 'genesis_header', 'blog_archive_remove_page_title');
function blog_archive_remove_page_title () {
if (is_front_page()) {
@topleague
topleague / tampermonkey-script-gmail.txt
Created October 9, 2019 16:27
TamperMonkey Script for Gmail Layout
// ==UserScript==
// @name Gmail Font Type and Size
// @include https://mail.google.com/mail*
// @description Set Gmail font to classic view
// @version 1.0
// ==/UserScript==
(function() {
'use strict';
function addGlobalStyle(css) {
@topleague
topleague / manual-excerpts-page-titles-genesis.php
Created September 14, 2019 17:12
Display Manual Excerpts Below Page Titles
//* Add Excerpt support to Pages
add_post_type_support( 'page', 'excerpt' );
//* Output Excerpt on Pages
add_action( 'genesis_meta', 'lwp_page_description_meta' );
function lwp_page_description_meta() {
if ( is_singular() && is_page() && has_excerpt() ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_after_header', 'lwp_open_after_header', 5 );
@topleague
topleague / google-fonts-visual-editor-genesis.php
Created September 14, 2019 17:02
ADD EDITOR STYLE TO YOUR WORDPRESS THEME
//* ADD EDITOR STYLE TO YOUR WORDPRESS THEME
add_action( 'init', 'cd_add_editor_styles' );
/**
* Apply theme's stylesheet to the visual editor.
*
* @uses add_editor_style() Links a stylesheet to visual editor
* @uses get_stylesheet_uri() Returns URI of theme stylesheet
*/
function cd_add_editor_styles() {
@topleague
topleague / make-website-google-amp-compliant.txt
Created September 14, 2019 16:55
Customize Standard AMP Pages with Glue for Yoast SEO & AMP Plugin
.amp-wp-header {
background-color: #d68231;
}
.amp-wp-header a {
color: #fff;
text-decoration: none;
font-weight: bold;
}
@topleague
topleague / responsive-feature-comparison-tables.txt
Created September 14, 2019 14:28
Create Responsive Feature Comparison Table in Genesis
<table>
<thead>
<tr>
<td>Features</td>
<th>iPhone 5</th>
<th>iPhone 6</th>
<th>iPhone 7</th>
<th>iPhone 8</th>
</tr>
</thead>
@topleague
topleague / responsive-feature-comparison-tables.txt
Created September 14, 2019 14:25
Create Responsive Feature Comparison Table in Genesis
<table>
<thead>
<tr>
<th>Features</th>
<th>iPhone 5</th>
<th>iPhone 6</th>
</tr>
</thead>
<tbody>
<tr>
@topleague
topleague / responsive-feature-comparison-tables.txt
Created September 14, 2019 14:19
HTML and CSS for creating responsive table in Genesis
<table>
<thead>
<tr>
<th>Features</th>
<th>iPhone 5</th>
<th>iPhone 6</th>
</tr>
</thead>
<tbody>
<tr>