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 | |
/* List only child pages of a page - not grandchildren | |
*/ | |
?> | |
<ul class="clearfix"> | |
<?php wp_list_pages( array('title_li'=>'','include'=>get_post_top_ancestor_id()) ); ?> | |
<?php wp_list_pages( array('title_li'=>'','depth'=>1,'child_of'=>get_post_top_ancestor_id()) ); ?> | |
</ul> |
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 a social media share box to your WordPress site. | |
If you want the email sharing, you'll need to install WP-Email: http://wordpress.org/extend/plugins/wp-email/ | |
Insert <?php s25_sharing_caring(); ?> to your template where you want the box to appear. Must be used inside the Loop. | |
Facebook Like Button code can be built here: http://developers.facebook.com/docs/reference/plugins/like/ | |
Tweet Button code: https://dev.twitter.com/docs/tweet-button | |
LinkedIn Share Button: http://developer.linkedin.com/plugins/share-plugin-generator | |
Google Plus 1: http://www.google.com/webmasters/+1/button/ |
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 Extra Profile Meta fields to WordPress user profile | |
*/ | |
//Extra Author Profile Meta | |
add_action( 'show_user_profile', 'my_show_extra_profile_fields' ); | |
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' ); | |
function my_show_extra_profile_fields( $user ) { ?> | |
<h3>Is this an active author?</h3> |
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
jQuery(document).ready(function($){ | |
$('a.fancybox').prepend('<img class="play" src="http://yoursite.com/path/to/img.png" alt="Play Video!" />'); | |
}); |
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 | |
/* | |
Template Name: User Directory | |
Inspirations for the code: @clarklab - http://clarklab.com/posts/sort-wordpress-users-by-custom-meta-value-with-get_users/ | |
@scribu - http://scribu.net/wordpress/advanced-metadata-queries.html | |
*/ | |
remove_action('genesis_loop', 'genesis_do_loop'); |
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 | |
/* Shortcodes for Vimeo, Youtube, and Ustream | |
* | |
* @author Pat Ramsey | |
* @link http://slash25.com/vimeo-and-youtube-iframe-shortcodes/ | |
* @param string $src, | |
* @param optional string $width, $height | |
* @return string iframe with modified strings $show_src, $show_width, $show_height | |
* |
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 | |
/** | |
* Merging two queries | |
* | |
*/ | |
$query1 = new WP_Query(array( | |
'post_type' => 'page', | |
'post_parent' => 341, | |
'post_status' => 'publish', |
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 | |
/** | |
* Set & read cookie for age-check in a Genesis child theme. On first visit to the site (any page) | |
* visitors are redirected to the page /age-check/. The age check page uses a custom page template | |
* containing part of the code here. The first two functions "set_newuser_cookie()" | |
* and "cur_page_url()" should go in your functions file. | |
* The code below that is for your custom page template. | |
* | |
* @author Pat Ramsey | |
* |
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 a taxonomy query to pre_get_posts to remove Quote post formats from the main query | |
* | |
* @author Pat Ramsey | |
* @link http://slash25.com | |
* | |
* @param array tax_query $args | |
* @return modified $query | |
*/ |