Skip to content

Instantly share code, notes, and snippets.

View seezee's full-sized avatar

Chris J. Zähller seezee

View GitHub Profile
@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 November 25, 2022 22:28
WEBP for WordPress
<?php
/**
* Support for WEBP.
*
* @package myplugin
*/
// Security.
if ( ! defined( 'ABSPATH' ) ) {
die( 'Sorry, you are not allowed to access this page directly.' );
@qstudio
qstudio / get_post_by_meta.php
Last active April 4, 2024 11:24
WordPress / Get Post by Meta Value
<?php
/**
* Get Post object by post_meta query
*
* @use $post = get_post_by_meta( array( meta_key = 'page_name', 'meta_value = 'contact' ) )
* @since 1.0.4
* @return Object WP post object
*/
function get_post_by_meta( $args = array() )
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active August 16, 2024 17:33
Using Git with Subversion Mirroring for WordPress Plugin Development