Skip to content

Instantly share code, notes, and snippets.

View joshapgar's full-sized avatar

Josh Apgar joshapgar

View GitHub Profile
@joshapgar
joshapgar / functions.php
Last active April 14, 2017 12:49
Dynamically reorder side navigation based on current page
<?php
/*******************************
* SIDEBAR NAVIGATION
*******************************/
function check_for_page_tree() {
//start by checking if we're on a page
if( is_page() ) {
global $post;
@joshapgar
joshapgar / functions.php
Created April 7, 2017 12:59
Link Button Shortcode with TinyMCE Button
<?php
/****************************
* Register Shortcodes
****************************/
add_action( 'init', 'register_shortcodes');
function register_shortcodes(){
add_shortcode('linkbutton', 'linkbutton_function');
}
function linkbutton_function( $atts, $content = null ) {
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(