有些Wordpress佈景主題本身沒有提供 Mobile Device 的版型,而是直接使用 Jetpack 的 mobile theme。
Jetpack 的 mobile theme 是以輕量化設計,所以預設不顯示 Logo 圖片(可以顯示網站主副標)
有些Wordpress佈景主題本身沒有提供 Mobile Device 的版型,而是直接使用 Jetpack 的 mobile theme。
Jetpack 的 mobile theme 是以輕量化設計,所以預設不顯示 Logo 圖片(可以顯示網站主副標)
function my_similar_post_text(){ |
這個 Plug In 是一個簡單的秀圖擴充功能,使用也很簡單
只要在超連結標籤 a 的屬性裡加上 rel="prettyPhoto" 即可
例如:
<a href="大圖路徑" rel="prettyPhoto" title="圖片描述"><img src="縮圖路徑" width="60" height="60" alt="縮圖替代文字" /></a> |
或是在 Shortcode 前後加上超連結標籤也可以。
<a href="大圖路徑" rel="prettyPhoto" title="圖片描述">[caption id="attachment_165" align="alignnone" width="200"]</a> |
Pretty Photo PlugIn 應該是在頁頭插入 Javascript 程式,一載入網頁就會檢查所有超連結是否有 rel="prettyPhoto";如果有就綁定Show 圖程式在該元素上。
每一篇 post 或是 page 或是其他頁面型態,都會有一個獨一無二的 ID代碼。
如果要想針對特定頁面定義 CSS,不想影響全部的頁面的話,可以利用 Google Chrome Browser,利用它先找到你要定義 CSS 的目標,然後在該 element 上按下滑鼠右鍵,選擇 Copy → Copy Selector,然後去 wordpress 的 佈景主題樣式表 style.css 中,去新增你的定義!
例如:
#post-721 > div > div > div > a.title{ #post-721 > div > div > div{ #post-721 > div > div > div:hover{ |
首先要去查一下佈景主題裡 哪裡呼叫執行,通常是在 functions.php
add_filter( 'get_the_excerpt', 佈景主題自定的 Reading More函式名稱' );
add_filter('excerpt_more', 佈景主題自定的 Reading More函式名稱');
add_filter('the_content_more_link', 佈景主題自定的 Reading More 函式名稱');
以上三個是佈景主題呼叫 add_filter 去修改 wordpres 內定 Read more 文字。
如果有發現的話,記下佈景主題的函式名稱,
然後在 functions.php 程式碼最後呼叫執行對應的
remove_filter( 'get_the_excerpt', 佈景主題自定的 Reading More函式名稱' );
remove_filter('excerpt_more', 佈景主題自定的 Reading More函式名稱');
remove_filter('the_content_more_link', 佈景主題自定的 Reading More 函式名稱');
接下來寫好自定 Read More 函式,再去呼叫 add_filter,讓你自定的函式與 wordpress 掛勾(hook)
remove_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' ); function my_excerpt_more($more) { |
remove_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' ); function my_continue_reading_link() { function my_custom_excerpt_more( $output ) { |
PS.如果佈景主題本身有定義 Read More 文字,你卻沒呼叫 remove_filter ,會造成新舊 Read More 文字都同時出現。