This file contains hidden or 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 include_font_awesome() { | |
wp_enqueue_style('font_awesome', '//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css'); | |
} | |
/* When 'wp_enqueue_scripts' takes place, trigger this function */ | |
add_action('wp_enqueue_scripts', 'include_font_awesome', 100); |
This file contains hidden or 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 | |
class My_Shortcode extends Shortcode { | |
public function main($atts, $content) { | |
echo "This is a really easy way to add shortcodes!"; | |
} | |
} | |
$My_Shortcode = new My_Shortcode; | |
$My_Shortcode->add(); |
This file contains hidden or 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 | |
/* Return the ultimate ancestor of a post */ | |
function get_post_ancestor($postID) { | |
$post = get_post($postID); | |
if (!is_object($post)) return; | |
while ($post->post_parent != 0): $post = get_post($post->post_parent); endwhile; | |
return $post; | |
} |
NewerOlder