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 | |
/** | |
* Comment Parent Check | |
* | |
* Returns true if comment is a parent comment | |
* and false if it is child comment | |
* | |
*/ | |
function aa_comment_parent($aa_comment_id) { |
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 | |
/** | |
* Similar posts loop | |
*/ | |
$categories = get_the_category(); //get all categories for this post | |
$cat_id = $categories[0]->cat_ID; | |
echo $cat_id; | |
$args = array( | |
'orderby' => 'date', | |
'order' => 'DESC', |
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 | |
/** | |
* WP Post Featured Image Url Function | |
* @param string $ai_post_id WP post id | |
* @param string $aa_size WP defined image size | |
* @return string src of featured image | |
*/ | |
function aa_return_img_url($ai_post_id, $aa_size) { | |
$dom = simplexml_load_string(get_the_post_thumbnail($ai_post_id, $aa_size)); | |
$src = $dom->attributes()->src; |
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 | |
/** | |
* Gravatar Image WP Custom Function | |
* @param string $aa_email user/author email address | |
* @param string $aa_size size of gravatar | |
* @return string gravatar image url | |
*/ | |
function aa_get_gravatar($aa_email, $aa_size) { | |
// Convert email into md5 hash and set image size to 200 px |
NewerOlder