Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin Name: Remove H1 Format
* Plugin URI: http://calliaweb.co.uk/modify-tinymce-editor/
* Description: A simple plugin to remove the H1 format from the WordPress TinyMCE editor.
* Version: 0.0.1
* Author: Jo Waltham
* Author URI: http://calliaweb.co.uk/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@robneu
robneu / wordpress-seo-keywords-bs.php
Created September 16, 2013 13:40
WordPress SEO without a plugin is complete crap. Let's break it down one function at a time.
<?php
function basic_wp_seo() {
global $page, $paged, $post;
$default_keywords = 'wordpress, plugins, themes, design, dev, development, security, htaccess, apache, php, sql, html, css, jquery, javascript, tutorials'; // customize
$output = '';
// description
$seo_desc = get_post_meta($post->ID, 'mm_seo_desc', true);
$description = get_bloginfo('description', 'display');
$pagedata = get_post($post->ID);
@robneu
robneu / genesis-woocommerce-sidebars.php
Last active June 24, 2025 00:02
Switch up the sidebars for various WooCommerce pages in a Genesis theme
<?php
add_filter( 'genesis_attr_sidebar-primary', 'prefix_store_sidebar_attr' );
/**
* Callback for filtering the Genesis sidebar on store pages.
*
* Add custom attributes for the custom filter.
*
* @param array $attributes The existing element attributes.
* @return array $attributes The updated element attributes.
@robneu
robneu / example-required.php
Last active December 11, 2024 18:57
A proxy loader file to load an example plugin inside the mu-plugins directory
<?php
/**
* Plugin Name: Example MU Plugin
* Plugin URI: http://example.com
* Description: Site-specific plugin for example.com
* Version: 1.0.0
* Author: FAT Media
* Author URI: http://youneedfat.com
*/
@robneu
robneu / truncate-yoast-breadcrumb.php
Last active October 8, 2024 19:05
Truncate the title of Yoast's WordPress SEO breadcrumbs.
<?php
/**
* Truncate the title of Yoast's WordPress SEO breadcrumbs.
*
* Sometimes you will have post titles which are longer than you want
* them to be in your breadcrumbs. This will allow you to set a maximum
* length for the post title used in Yoast's breadcrumb function.
*
* @author FAT Media, LLC
* @link http://wpbacon.com/tutorials/truncate-wordpress-seo-breadcrumbs/
@robneu
robneu / get-script-handles.php
Last active April 25, 2024 01:01
Display a list of all currently enqueued script handles. Useful for manual minification when using Better WordPress Minify and other similar plugins.
<?php
/**
* Output a list of all enqueued script handles.
*
* @author FAT Media, LLC
* @global $wp_scripts
* @todo Change 'prefix' to your theme or plugin prefix.
*/
function prefix_print_script_handles() {
@robneu
robneu / wordpress-typekit-enqueue.php
Last active January 17, 2023 23:04 — forked from FernE97/typekit-enqueue.php
Enqueue typekit fonts to WordPress using wp_enqueue_scripts.
<?php
/**
* Enqueue typekit fonts into WordPress using wp_enqueue_scripts.
*
* @author Robert Neu
* @author Eric Fernandez
* @copyright Copyright (c) 2014, Robert Neu
* @license GPL-2.0+
* @link http://typekit.com
*/
@robneu
robneu / wordpress-font-awesome-cdn.php
Last active November 29, 2022 10:47
Add Font Awesome to WordPress using a CDN
<?php
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_awesome' );
/**
* Register and load font awesome CSS files using a CDN.
*
* @link http://www.bootstrapcdn.com/#fontawesome
* @author FAT Media
*/
function prefix_enqueue_awesome() {
wp_enqueue_style( 'prefix-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3' );
@robneu
robneu / facet-wp-infinite-scroll.js
Last active October 9, 2021 22:26
Infinite scroll for FacetWP
/* globals FWP */
/**
* JavaScript for FacetWP Infinite Scroll
*/
(function( $ ) {
'use-strict';
var throttleTimer = null;
var throttleDelay = 100;
<?php
add_action( 'wp_enqueue_scripts', 'prefix_disable_wp_featherlight_woocommerce', 10 );
/**
* Remove all required scripts and styles on WooCommerce pages.
*
* @since 0.1.0
* @access public
* @return void
*/
function prefix_disable_wp_featherlight_woocommerce() {