標籤: Jetpack
- This topic has 0 則回覆, 1 個參與人, and was last updated 3/21 06:47 by 小波.
正在檢視 0 則發表的回覆
- 作者文章
- 小波管理員OfflineTopics: 35Replies: 12
- functions.php
- function lvuptech_more_related_posts( $options ) {
$options[‘size’] = 6;
return $options;
}
add_filter( ‘jetpack_relatedposts_filter_options’, ‘lvuptech_more_related_posts’ ); - 另外建議改image size(觀察目前版面圖片大小而定,大於等於即可)
function lvuptech_custom_thumb_size( $get_image_options ) {
$get_image_options[‘avatar_size’] = 200;
return $get_image_options;
}
add_filter( ‘jetpack_top_posts_widget_image_options’, ‘lvuptech_custom_thumb_size’ );
- function lvuptech_more_related_posts( $options ) {
- 自訂CSS(不加這段會導致第三篇文章就換行)
- 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;
}
}
- 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) {
昨天本來想換theme, 結果還是沒有目前這個好,浪費6個小時…
目前的畢竟也是修修改改了許多小地方,有機會再研究吧,
反正載入效率和安全性問題也改善了,就先這樣吧。 - functions.php
- 作者文章
正在檢視 0 則發表的回覆