Skip to content

Instantly share code, notes, and snippets.

@bewho
bewho / remove_revslider_meta_generator.php
Created May 25, 2018 10:17 — forked from jimi008/remove_revslider_meta_generator.php
Remove woo framework, canvas theme & Revolution slider meta generator from site
<?php
function remove_revslider_meta_tag() {
return '';
}
add_filter( 'revslider_meta_generator', 'remove_revslider_meta_tag' );
?>
@bewho
bewho / cached_nav_menu.php
Created May 27, 2018 04:14 — forked from marcinzaremba/cached_nav_menu.php
Primitve cached version of wp_nav_menu
/**
* cached_nav_menu
*
* primitive cache of wp_nav_menu using
* WP Transient APIs
*
* @author Marcin Zaremba
* @param $args arguments passed originally to wp_nav_menu
*/
function cached_nav_menu($args) {
@bewho
bewho / definition-lists-with-wp_nav_menu.php
Created May 27, 2018 04:16 — forked from Narga/definition-lists-with-wp_nav_menu.php
Use definition lists with wp_nav_menu
// Secondary Menu is Widgetable
function widget_secondary_navigation() {
$args = array(
'echo' => false,
'items_wrap' => '<dl id="%1$s" class="%2$s myclass">%3$s</dl>','theme_location' => 'secondary_navigation', 'container' => false, 'menu_class' => 'sub-nav'
);
$subject = wp_nav_menu( $args );
$search = array('<ul', '</ul>', '<li', '</li>');
$replace = array('<dl', '</dl>', '<dd', '</dd>');
@bewho
bewho / functions.php
Created May 30, 2018 08:26 — forked from ahmadawais/functions.php
SEO by Yoast Stuff
/**
* Filter Yoast SEO Metabox Priority to low
*/
add_filter( 'wpseo_metabox_prio', 'aa_filter_yoast_seo_metabox' );
function aa_filter_yoast_seo_metabox() {
return 'low';
}
/**
* Remove Yoast SEO Metabox
@bewho
bewho / tip.md
Created May 30, 2018 08:28 — forked from ahmadawais/tip.md
TIP: Write Better Articles

Write Better Articles

Here're a few good rules that you can make sure every writer follows to keep things civil and readable.

  • 📨No para should have less than three and more than four lines
@bewho
bewho / functions.php
Created June 7, 2018 08:18 — forked from paulcollett/functions.php
Remove Yoast HTML Comments “This site is optimized with the Yoast WordPress SEO plugin”
// Add to your Wordpress Theme's functions.php
// Remove All Yoast HTML Comments
// https://gist.github.com/paulcollett/4c81c4f6eb85334ba076
add_action('wp_head',function() { ob_start(function($o) {
return preg_replace('/^\n?<!--.*?[Y]oast.*?-->\n?$/mi','',$o);
}); },~PHP_INT_MAX);
@bewho
bewho / index.html
Created June 8, 2018 07:59 — forked from aFarkas/index.html
link[rel="preload"] polyfill
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!-- we use 'preload_' instead of 'preload' to make it testable in chrome -->
<link rel="preload_" onload="console.log(this, 'script');" href="http://code.jquery.com/jquery-1.12.1.js" as="script" />
<link rel="preload_" onload="console.log(this, 'style');" href="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css" as="style" />
<link rel="preload_" onload="console.log(this, 'font');" href="LatoLatin-Regular.woff" as="font" type="font/woff" crossorigin="" />
@bewho
bewho / functions.php
Created June 8, 2018 08:06 — forked from designrubenz/functions.php
Wordpress: reduce to the max
<?php
function wp_customize_admin_menu() {
remove_menu_page( 'edit.php' );
remove_menu_page( 'edit-comments.php' );
remove_submenu_page( 'themes.php', 'theme-editor.php' );
remove_submenu_page( 'plugins.php', 'plugin-editor.php' );
remove_submenu_page( 'tools.php', 'tools.php' );
remove_submenu_page( 'tools.php', 'import.php' );
remove_submenu_page( 'options-general.php', 'options-discussion.php' );
body.wpex-noscroll {
position: static !important;
width: auto !important;
overflow-y: inherit !important;
top: auto !important;
bottom: auto !important;
}
@bewho
bewho / nginx.conf
Created June 26, 2018 01:29 — forked from apmarshall/nginx.conf
Boilerplate Config file for nginx, originally written for a Joomla instal. @nikosdion/master-htaccess
server {
######################################################################
## The Master .htaccess - NginX adaptation
##
## Version 3.3
##
## This file is designed to be the template NginX server configuration file
## for your Joomla! sites. You should go through all of its sections and
## modify it to match your site. Most notably, all instances of example.com
## and example\.com should be replaced with your real domain name.