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 topratings_function() { | |
/** | |
* Adds the Tasty Recipes ratings to the top of the post. | |
* | |
* @param string $content Existing post content. | |
* @return string | |
*/ | |
add_filter( 'the_content', function( $content ) { |
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
// Social sharing | |
function social_sharing_buttons($content) { | |
global $post; | |
if(is_singular() || is_home()){ | |
// Get current page URL | |
$crunchifyURL = urlencode(get_permalink()); | |
// Get current page title |
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
//Get the first image from the post | |
function get_first_image_url() { | |
global $post, $posts; | |
$first_img = ''; | |
ob_start(); | |
ob_end_clean(); | |
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); | |
$first_img = $matches[1][0]; |
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 class="author-block"> | |
<div class="author-avatar"> | |
<?php echo get_avatar( get_the_author_meta( 'ID' ), 48 );?> | |
</div> | |
<div class="by">by</div> | |
<div class="author-name"><?php the_author(); ?></div> | |
<div class="timestamp"><?php the_modified_time('F j, Y'); ?></div> | |
</div> |
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 class="relatedposts"> | |
<h3>Related posts</h3> | |
<?php | |
global $post; | |
setup_postdata( $post ); | |
echo "Post's ID: " . get_the_ID(); | |
?> | |
<?php | |
$orig_post = $post; | |
global $post; |
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
// numbered pagination | |
function pagination($pages = '', $range = 4) | |
{ | |
$showitems = ($range * 2)+1; | |
global $paged; | |
if(empty($paged)) $paged = 1; | |
if($pages == '') | |
{ |
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
article{ | |
position:relative; | |
&:after{ | |
content: "\f15c"; | |
font-family: FontAwesome; | |
font-style: normal; | |
font-weight: normal; | |
text-decoration: inherit; | |
/*--adjust as necessary--*/ | |
color: $brand-main-color; |
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 numeric_posts_nav(); ?> |
NewerOlder