Skip to content

Instantly share code, notes, and snippets.

@bewho
bewho / wp-remove-feed-links.php
Created May 15, 2017 08:17 — forked from derekshirk/wp-remove-feed-links.php
WordPress - Remove Feed Links
@bewho
bewho / functions.php
Created May 15, 2017 08:20 — forked from paulburgess/functions.php
Useful functions for Wordpress
<?php
//require( get_template_directory() . '/_/inc/_custom-post-types.php' );
// Load jQuery
if ( !function_exists( 'core_mods' ) ) {
function core_mods() {
if ( !is_admin() ) {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', ( "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ), false);
@bewho
bewho / functions.php
Created May 15, 2017 08:38 — forked from khoipro/functions.php
Remove default stylesheets from frontend WordPress
// remove auto stylesheet from admin + wp
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
wp_deregister_style( 'dashicons' );
wp_deregister_style( 'admin-bar' );
wp_deregister_style( 'open-sans' );
wp_deregister_style( 'boxes' );
}
@bewho
bewho / prefetch-url.js
Created May 25, 2017 14:06 — forked from mcnamee/prefetch-url.js
Prefetch URL on Hover
(function($) {
// Which links should we prefetch?
var $linkElements = $(".menu-item a");
$linkElements.on("hover", function() {
var link = $(this).attr("href"),
prerenderLink = $("#prerenderLink");
if (prerenderLink.length) {
if (prerenderLink.attr("href") === link) return;
prerenderLink.attr("href", link);
@bewho
bewho / clean-wordpress-head-4.6.1
Created May 26, 2017 03:20 — forked from pedro-vasconcelos/clean-wordpress-head-4.6.1
Remove Wordpress Junk from Header
// REMOVE WP EMOJI
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
// First, we remove all the RSS feed links from wp_head using remove_action
remove_action( 'wp_head','feed_links', 2 );
@bewho
bewho / meta.md
Created June 6, 2017 06:23 — forked from enterstudio/meta.md
add details through meta

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@bewho
bewho / news_meta.php
Created June 6, 2017 06:26 — forked from geilt/news_meta.php
Wordpress News Meta
<?php
/*
* Title: News Meta Function
* Author: Alexander Conroy
* Version: 1.0.1
* Website: http://www.esotech.org
* Purpose: Tags Tags for Current Post and puts it in the header meta comma separated maximum 10 tags.
* License: GPLv3+
*/
@bewho
bewho / optimized-htaccess-wp
Created June 6, 2017 11:23 — forked from ingozoell/optimized-htaccess-wp
Optimized .htaccess file for WordPress (based on HTML5 Boilerplate)
################################################################################################################
# #
# HTML5 BOILERPLATE #
# https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess #
# 04/01/2013 #
################################################################################################################
@bewho
bewho / README.md
Created June 6, 2017 11:39
Config files

Config files for PHP, Apache, Memcache, Wordpress, Pagespeed and other services

@bewho
bewho / gist:7cc3be10d64d0f443e33c49df3a027e9
Created September 5, 2017 12:44 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>