Skip to content

Instantly share code, notes, and snippets.

// Custom WordPress Login Logo
function login_css() {
wp_enqueue_style( 'login_css', get_template_directory_uri() . '/css/login.css' );
}
add_action('login_head', 'login_css');
<?php
/* Add Class to first Paragraph in WordPress the_content();
Source: http://webdevbits.com/wordpress/add-class-to-first-paragraph-in-wordpress-the_content/
------------------------------------------------------------------------------------------- */
function first_paragraph($content){
if ( is_page() || ('school' == get_post_type() ) ) {
return preg_replace('/<p([^>]+)?>/', '<p$1>', $content, 1);
} else {
return preg_replace('/<p([^>]+)?>/', '<p$1 class="intro">', $content, 1);
/**
* Extended Walker class for use with the
* Twitter Bootstrap toolkit Dropdown menus in Wordpress.
* Edited to support n-levels submenu.
* @author johnmegahan https://gist.github.com/1597994, Emanuele 'Tex' Tessore https://gist.github.com/3765640
*/
class BootstrapNavMenuWalker extends Walker_Nav_Menu {
function start_lvl( &$output, $depth ) {
/**
* This class removes the default excerpt metabox
* and adds a new box with the wysiwyg editor capability
* @author etessore
*/
class TinyMceExcerptCustomization{
const textdomain = '';
const custom_exceprt_slug = '_custom-excerpt';
var $contexts;
<?php // Add Lightbox to Wordpress Gallery
add_filter( 'wp_get_attachment_link', 'prettyPhoto');
function prettyPhoto ($content) {
$content = preg_replace("/<a/","<a rel=\"prettyPhoto[slides]\" class=\"preloader\"",$content,1);
return $content;
} ?>