Last active
January 5, 2016 00:28
-
-
Save neilgee/e9772ebd0df2c42b033e to your computer and use it in GitHub Desktop.
JetPack Related Posts
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
/* You may need to add the !important declaration if your JetPacks CSS loads last - this works for a 6 up layout */ | |
div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+1), div#jp-relatedposts div.jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+1) { | |
clear: left; | |
} | |
@media only screen and (max-width: 640px) { | |
div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+1), div#jp-relatedposts div.jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+1) { | |
clear: none; | |
} | |
div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post:nth-child(3n) { | |
clear: none; | |
} | |
div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post:nth-child(2n+1) { | |
clear: left; | |
} | |
} |
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 //<~ don't add me in, but add the rest to functions.php | |
//Change Related Post HEadline | |
function jetpackme_related_posts_headline( $headline ) { | |
$headline = sprintf( | |
'<h3 class="jp-relatedposts-headline"><strong>%s</strong></h3>', | |
esc_html( 'Similar Stuff Going On' )//change your headline here | |
); | |
return $headline; | |
} | |
add_filter( 'jetpack_relatedposts_filter_headline', 'jetpackme_related_posts_headline' ); |
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 //<~ don't add me in, but add the rest to functions.php | |
function jetpackme_more_related_posts( $options ) { | |
$options['size'] = 6; //change the number for the amount required | |
return $options; | |
} | |
add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_more_related_posts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment