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 | |
/** | |
* Filter YouTube oEmbed to include '&rel=0' to force channel related videos | |
* once video is complete, rather than showing user related videos. | |
* | |
* @param $html | |
* @param $url | |
* @param $args | |
* | |
* @return mixed |
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 | |
$ancestors = get_post_ancestors($post->ID); | |
if (empty($ancestors)) { | |
$last_ancestor = $post->ID; | |
} else { | |
$last_ancestor = $ancestors[count($ancestors) - 1]; | |
} | |
?> |
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 | |
$big = 999999999; | |
echo paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '/page/%#%', | |
'current' => max( 1, get_query_var('paged') ), | |
'total' => $my_query->max_num_pages, | |
'prev_text' => __( 'Previous' ), | |
'next_text' => __( 'Next' ), |
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 ag_show_me_hooks() { | |
global $wp_current_filter; | |
var_dump( $wp_current_filter ); | |
} | |
add_action( 'all', 'ag_show_me_hooks' ); |
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 | |
$rss = new DOMDocument(); | |
$rss->load( 'http://wordpress.org/news/feed/' ); | |
$feed = array(); | |
foreach ( $rss->getElementsByTagName( 'item' ) as $node ) { | |
$item = array( | |
'title' => $node->getElementsByTagName( 'title' )->item(0)->nodeValue, | |
'link' => $node->getElementsByTagName( 'link' )->item(0)->nodeValue, |
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
<!-- | |
.,;+###+;:. | |
.##;` .'@: | |
`@+ +# | |
#' `@` | |
`@` `@ | |
``:::.` @. +. | |
`#+` ;@ `# '. | |
`@ `@ :; @ | |
@` @; + |
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
# First run an apt-get update to be sure everything is good | |
# Install tasksel | |
sudo apt-get install tasksel | |
# Now install LAMP | |
sudo tasksel install lamp-server | |
# Success! Have some whiskey. |
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
# Do the following command | |
# Ref: http://soderlind.no/archives/2011/08/26/running-wordpress-locally-on-mac-os-x-lion/ | |
# Chown / Chmod site directory | |
$ sudo chown -R :_www [site_directory] | |
$ sudo chmod -R g+w [site_directory] | |
# Add to "wp-config.php" | |
define('FS_METHOD', 'direct'); |
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 | |
/** | |
* My Project | |
* | |
* @package MyProject | |
* @subpackage JesGs_Walker_Category | |
* @author Jess Green <[email protected]> | |
* @version $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
<div id="container"> | |
<ul id="menu"> | |
<li><a href="#">About Me</a> | |
<ul> | |
<li><a href="#">Lorem ipsum dolor</a></li> | |
<li><a href="#">Maecenas lacinia sem</a></li> | |
<li><a href="#">Suspendisse fringilla</a></li> | |
</ul> | |
</li> | |
<li><a href="#">Portfolio</a> |