This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Google PDF Viewer Shortcode | |
Description: Display a PDF in the browser with Google's PDF viewer. Usage: [pdf]http://example.org/some-public-document.pdf[/pdf]. Can specify optional width and height attribrutes like this [pdf width="100" height="100"]http://example.org/a-very-tiny-document.pdf[/pdf] | |
Version: 1.0 | |
Author: Mark Root-Wiley | |
Author URI: https://mrwweb.com | |
*/ | |
/* a shortcode for embedding PDFs via Google Docs viewer */ | |
function nten_pdf_shortcode( $atts, $content = '' ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ //create closure so we can safely use $ as alias for jQuery | |
"use strict"; | |
$(document).ready(function(){ | |
var mainMenu = $('#primary-menu').superclick({ | |
activeClass: 'sf-active', // change active class from sfHover to sf-active | |
cssArrows: false, // no arrows (but you should probably provide your own) | |
speed: 1, // "no animation" | |
onShow: function() { | |
// keep off screen momentarily |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_head', 'mrw_highlight_empty_alt' ); | |
function mrw_highlight_empty_alt() { | |
if( is_user_logged_in() ) : ?> | |
<style> | |
[alt=""] { | |
border: 10px solid red !important; | |
} | |
</style> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Important! | |
Make sure to replace {my_} with your theme's unique prefix. | |
All future functions you write should use that same prefix. | |
Example: mrwnten_parent_theme_enqueue_styles() | |
*/ | |
add_action( 'wp_enqueue_scripts', '{my_}parent_theme_enqueue_styles' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'fpw_excerpt', 'fpw_replace_excerpt_with_content', 10, 2 ); | |
function fpw_replace_excerpt_with_content( $excerpt, $id ) { | |
return get_post_field( 'post_content', $id ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function key_my_array( $array_array ) { | |
$new_array_array = array(); | |
foreach( $array_array as $array ) { | |
$first = array_shift($array); | |
$new_array_array[$first] = $array; | |
} | |
return $new_array_array; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function key_my_array( $array_array ) { | |
$new_array_array = array(); | |
foreach( $array_array as $array ) { | |
$first = array_shift($array); | |
$new_array_array[$first] = $array; | |
} | |
return $new_array_array; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*================================================ | |
* SCSS | |
================================================*/ | |
/* Import Breakpoint */ | |
@import "breakpoint"; | |
/* Named Media Queries */ | |
@include breakpoint-set( 'to ems', true ); | |
$tiny: ('screen') 300px, 'no-query' true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'get_the_archive_title', '{prefix}_cat_title' ); | |
/** | |
* Remove "Category: " prefix from Category archive pages | |
*/ | |
function {prefix}_cat_title( $title ) { | |
if( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function {prefix}_post_class( $classes ) { | |
if( is_archive() && is_sticky() ) { | |
$classes[] = 'sticky'; | |
} | |
return $classes; | |
} | |
add_filter( 'post_class', '{prefix}_post_class' ); |