Skip to content

Instantly share code, notes, and snippets.

@bewho
bewho / functions.php
Created October 10, 2018 01:40 — forked from voneff/functions.php
WordPress: unregister custom post type registered by plugin "Essential Grid"
<?php
/*
* Use this funtion to delete the custom post type registered by the plugin "Essential Grid"
* Alternative method to the one proposed by plugin authors:
* https://www.themepunch.com/faq/hide-ess-grid-posts-custom-post-type-from-wp-main-menu/
*
* Usage for other CPT: Replace 'essential_grid' with the slug of the custom post type
*
* Sources:
* https://gist.github.com/johnkolbert/769160
@bewho
bewho / functions.php
Created October 9, 2018 03:35 — forked from AlbertoMontalesi/functions.php
wordpress files
<?php
/**
* thim functions and definitions
*
* @package thim
*/
define( 'THIM_DIR', trailingslashit( get_template_directory() ) );
define( 'THIM_URI', trailingslashit( get_template_directory_uri() ) );
define( 'THIM_THEME_VERSION', '3.4.3' );
@bewho
bewho / nofollow.php
Created September 1, 2018 07:56 — forked from sowich/nofollow.php
<?php
add_filter('wp_list_categories', 'esc_wp_rel_nofollow');
add_filter('wp_tag_cloud', 'esc_wp_rel_nofollow');
function esc_wp_rel_nofollow($output)
{
if (is_single() || is_category() || is_tag())
return stripslashes(wp_rel_nofollow($output));
return $output;
<?php
/**
* Enqueue 404 Script
*
*/
function be_404_script() {
if( is_404() )
wp_enqueue_script( 'be-404', get_stylesheet_directory_uri() . '/js/404.js', array( 'jquery' ), '1.0', true );
}
@bewho
bewho / functions-performance-php
Last active September 1, 2018 07:28 — forked from Auke1810/functions-performance-php
Wordpress performance snippets for functions.php
################# performance snippets ###########################################
/**
* decrease jpeg quality to 80
*/
add_filter( 'jpeg_quality', create_function( '', 'return 80;' ) );
/**
* Disable the emoji's
*/
@bewho
bewho / gist:27309bc11f4bb6bfa07beeedade162ce
Created September 1, 2018 07:27 — forked from billerickson/gist:1325314
Add rel=nofollow to categories
<?php
/**
* Add rel=nofollow to wp_list_categories
* @link http://www.billerickson.net/adding-nofollow-to-category-links/
* @author Bill Erickson
*/
function add_nofollow( $text ) {
$text = stripslashes($text);
$text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
@bewho
bewho / yoast-seo-aanpassingen-functions.php
Created September 1, 2018 07:20 — forked from Auke1810/yoast-seo-aanpassingen-functions.php
Custom aanpassingen aan yoast seo meta robot tag en canonical tag tbv technische optimalisatie van wordpress woocommerce webshop
################# SEO Aanpassingen ###########################################
# https://gist.github.com/Auke1810/9939b52131bdb2af819143798aba60f2
##############################################################################
/**
* add_noindex_tags
* meta robots tag vullen met de juiste instelling per pagina type
* Gepagineerde pagina’s (zonder parameters) moeten index, follow zijn.
* Gepagineerde pagina’s met parameters mogen een noindex, nofollow
*/
@bewho
bewho / Base Child theme functions.php
Created September 1, 2018 07:12
Wordpress child theme functions boiler template
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/*-----------------------------------------------------------------------------------
Title: Child theme functions.php
Description: Functies/Action/filter/hooks used for Wordpress childtheme
Author: Auke Jongbloed
Author Uri: www.wordpressassist.nl
Version: 1.4.0
Tags: Wordpress, wordpressassist, functions.php
@bewho
bewho / remove-yoast-footer
Created July 26, 2018 06:54
remove YOAST footer
@bewho
bewho / readme.md
Created July 25, 2018 07:31 — forked from nielslange/readme.md
Web Development Checklist

Web Development Checklist

  • Remove obsolete content, e.g. Hello World
  • Remove obsolete plugins, e.g. Hello Dolly
  • Replace all placeholder texts, e.g. Lorem Ipsum
  • Replace all placeholder images, e.g. placeholder.png
  • Find and remove all broken links, e.g. with Broken Link Checker
  • Create 404 page
  • Create contact page
  • Create legal pages, e.g. Terms and conditions and Privacy Policy