Skip to content

Instantly share code, notes, and snippets.

@thetrickster
thetrickster / Remove Open Sans from Wordpress 3.8 .md
Last active March 8, 2022 12:26
Remove Open Sans from Wordpress >= 3.8 front-end

The reason you might not be able to remove the Open Sans font that Wordpress >= 3.8 adds to the frontend is that quite a few WP styles and scripts list 'open-sans' as a dependancy when being registered and enqueued. When you remove the 'open-sans' style the other plugins dependant on it will not load. So you just need to deregister WP's open sans style and register your own, with a false value for the src like below.

Credit to seventhsteel from http://wordpress.org/support/topic/turning-off-open-sans-for-the-38-dashboard

@clarklab
clarklab / wp_insert_post_front_end_form.php
Created May 25, 2012 00:12
This is a sample front-end form using wp_insert_post(). It's quickly stripped out of my production code from Android and Me, and hasn't been tested alone, so please take it with a grain of salt.
<?
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted
$title = $_POST['thread_title']; //set our title
if ($_POST['thread_description']=="") { // check if a description was entered
$description = "See thread title..."; // if not, use placeholder
} else {
$description = $_POST['thread_description']; //if so, use it
@hakre
hakre / theme-napkin.php
Created February 8, 2011 15:32
Theme Napkin Wordpress Plugin - Safeguard unintended output generated by theme bootstrap code (functions.php).
<?php
/**
* Theme Napkin Wordpress Plugin
*
* Safeguard unintended output generated by theme bootstrap code (functions.php).
*
* Copyright 2011 by hakre <http::/hakre.wordpress.com>, some rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License