Skip to content

Instantly share code, notes, and snippets.

<h2>NEWS</h2>
<p>&nbsp;</p>
<p><span style="color: #64add2;"><strong><a href="/web/20130729180519/http://www.nostrings.org.uk/wp/wp-content/uploads/2013/05/Hagurosan-cover.jpg"><img class="alignleft size-thumbnail wp-image-2943" alt="Hagurosan cover" src="/web/20130729180519im_/http://www.nostrings.org.uk/wp/wp-content/uploads/2013/05/Hagurosan-cover-126x100.jpg" width="126" height="100"></a></strong></span><span style="color: #64add2;"><strong><a href="/web/20130729180519/http://www.nostrings.org.uk/king-of-fantasy-darren-shans-new-novel-hargusan-raising-funds-for-no-strings/"><span style="color: #64add2;">Hagurosan, Darren Shan’s new book, out now!</span></a></strong></span>&nbsp;With all profits from Darren’s long-awaited new novel generously donated to No Strings. A terrific adventure from the master of fantasy, and one of the most successful authors writing today. <span style="color: #64add2;"><a href="/web/20130729180519/http://www.nostrings.org.uk/king-of-fantasy-darren-shans-new-novel-hargusan-raising
<?php
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) ) {
$src = remove_query_arg( 'ver', $src );
}
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
@stompweb
stompweb / dont-load-yoast.php
Created February 17, 2016 19:35
Don't load Yoast
<?php
function rmt_exclude_yoast_resource_centre( $plugins ) {
if ('' == sanitize_text_field($_GET['op'])) {
return $plugins;
}
$key = array_search('wordpress-seo/wp-seo.php', $plugins);
unset( $plugins[$key] );
<?php
function maybe_filter_content() {
if ('' != sanitize_text_field($_GET['op'])) {
add_filter("the_content", "rc_content_handler");
}
}
add_action('init', 'maybe_filter_content');
@stompweb
stompweb / issue.md
Last active November 4, 2015 19:40
WP adds -2 to end of slugs with just numbers in the title of hierarchical CPTs

Steps

  1. Create a hierarchical post type
  2. Add a post under that post type called '1990'
  3. Slug is created with -2 on the end even if a similar post doesn't already exist i.e. 1990-2

Doesn't happen for non-hierarchical post types

@stompweb
stompweb / add-editor-style.php
Created October 31, 2015 18:10
add editor style
<?php
function stomp_add_editor_styles() {
add_editor_style( 'css/editor-style.css' );
}
add_action( 'admin_init', 'stomp_add_editor_styles' );
@stompweb
stompweb / gulpfile.js
Created October 31, 2015 18:02
gulpfile
gulp.task('editor-style', function() {
return gulp
.src('css/editor-style.less')
.pipe(less())
.pipe(autoprefixer('last 2 version', "> 1%", "ie 8"))
.pipe(minify())
.pipe(gulp.dest('css'))
.pipe(notify({ message: 'Editor Style Compiled'}));
@stompweb
stompweb / editor-style.less
Created October 31, 2015 17:56
Editor Style
@import "style-guide.less";
@import "variables.less";
#tinymce {
.style-guide();
}
@stompweb
stompweb / style.less
Last active October 31, 2015 18:22
Styles
@import "style-guide.less";
@import "variables.less";
body {
font-size: 15px;
}
h1,
h2,
h3 {
@stompweb
stompweb / style-guide.less
Created October 31, 2015 17:39
Style Guide
.style-guide() {
font-family: @body-font;
h2,
h3 {
font-family: @header-font;
}
h2 {
font-weight: 300;