Skip to content

Instantly share code, notes, and snippets.

View seezee's full-sized avatar

Chris J. Zähller seezee

View GitHub Profile
accordion-group {
background-color: #f7f7f7;
border-radius: 0.25em;
display: block;
margin-block-end: 1.5em;
padding: 0.5em 1em;
width: 100%;
}
accordion-group [accordion-trigger] {
/**
* @section General Code Styles
*/
code,
kbd,
pre,
samp {
font-family: Menlo, Monaco, "Courier New", monospace;
font-size: 0.875em;
@seezee
seezee / social.php
Last active January 4, 2022 16:01
Filter to add lightweight social sharing to WP Genesis themes. Include via functions.php.
<?php
/**
* Social sharing buttons meta to Genesis.
*
* @package There is no package.
* @since 1.0.0
*/
// Security.
if ( ! defined( 'ABSPATH' ) ) {
@seezee
seezee / disable-wp-nav-link.js
Last active December 1, 2021 18:21
Disabled WordPress Navigation Links
@seezee
seezee / add-rel-to-images.php
Last active November 17, 2021 22:28
2 different ways to add rel="noopener noreferrer" to linked images in WordPress. Could be improved with a check for external links so we can also add "external".
<?php
/**
* Plugin Name: Add Rel to Images
* Description: Add rel="noopener noreferrer" to linked images.
*
* @package There is no package.
*/
/**
* With jQuery.
<?php
/**
* Displays the post modified date.
*
* @package There is no package.
*/
/**
* Returns the last modified date for the post with the <time> tag and the
* time zone.
@stephenkeep
stephenkeep / print_scripts_and_styles.php
Created December 31, 2020 13:01
Pagedart.com - Dump all script and style handles at the bottom of any page by adding ?pagedart onto the end of the URL while logged-in as an Administrator level user.
global $pd_scripts;
$pd_scripts = array();
function list_scripts($tag, $handle) {
global $pd_scripts;
$pd_scripts[] = $handle;
return $tag;
}
add_filter('script_loader_tag', 'list_scripts', 10, 2);
@seezee
seezee / feed-offset-template.php
Last active November 25, 2022 22:28
Customized WordPress RSS Feed. REPLACE the value of the variable $date before employing!
<?php
/**
* RSS2 Feed Template for displaying RSS2 Posts feed.
* Adds an offset of "1" to display all but most recent
*
* Full details at:
* https://wordimpress.com/anatomy-advanced-wordpress-blog-notification-email
*
* @package Your Package Name
*/
@seezee
seezee / webp.php
Last active March 23, 2025 19:34
WEBP for WordPress
<?php
/**
* Support for WEBP.
*
* @package myplugin
*/
// Security.
if ( ! defined( 'ABSPATH' ) ) {
die( 'Sorry, you are not allowed to access this page directly.' );