分類彙整: Wordpress部落格

Tag or Category term_group Order – 在wordpress中排列分類及標籤順序

過去在wordpress中要自行排列分類的順序,都可以使用category order或my category order這兩個插件。但是自從wordpress升級到3.1版以後,這些插件似乎都有點問題而不再適用了。於是我找到Tag or Category term_group Order這個插件,這個插件可以用數字大小來指定分類或標籤的順序,安裝之後,分類和標籤的編輯頁面就多了一個group的欄位可以輸入數字。但要記得在布景主題中的wp_list_categories敘述後面加入orderby=term_group即可。

WordPress 好用外掛 – 把每個子部落格的文章集中 WordPress MU Sitewide Tags Pages

安裝多部落格系統之後,需要有個功能是可以把所有子部落格的文章集中顯示在某個部落格(或是主部落格)的頁面上。安裝WordPress MU Sitewide Tags Pages這個外掛,就能夠決定要把所有文章顯示在一個新建立的子部落格,或是主部落格上頭。

PHP 筆記 – 用curl取代file_get_contents

在安裝布景主題的時候,發現程式中有用到file_get_contents這個指令,如果PHP的設定中沒有把allow_url_fopen這個功能打開,就會出現警示訊息,而且無法讀到外部連結的內容。但是開啟allow_url_fopen這個功能又很危險,因為駭客會把程式碼放在連結中,一旦程式讀取到惡意的程式碼,那網站跟資料庫的內容就有危險了。

所以我在網路上查到有人用curl取代file_get_contents的用法:

$updateUrlContent = file_get_contents($themeUpdateUrl);
改成
$curl = curl_init($themeUpdateUrl);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$updateUrlContent = curl_exec($curl);
curl_close($curl);

相關說明:http://www.christianschenk.org/blog/php-curl-allow-url-fopen/

解碼:http://www.tareeinternet.com/scripts/decrypt.php

WordPress 安裝筆記 – 4.把落落長的文章分頁

2014.01.03更新
現在好像只要在文章裡打

<!--nextpage-->

就可以分頁了!!

參考資料:http://codex.wordpress.org/Styling_Page-Links
——————-

4.把文章分頁
4.1資料來源:艾德的部落格天空
4.2在single.php中,找到

<?php the_content(); ?>

在其下方加入以下敘述:

<div class="link_pages"><?php wp_link_pages(array('before' => '<p><strong>文章分頁: </strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?></div>

4.3打開style.css在檔案最下方加入以下敘述

/* 單篇文章分頁 */
.link_pages {
font: 12px Verdana, Arial, Helvetica, sans-serif;
padding-top: 30px;
padding-bottom: 10px;
margin: 0px;
}
 
.link_pages a {
padding: 2px 6px;
border: solid 1px #ddd;
background: #fff;
text-decoration: none;
}
 
.link_pages a:hover {
color: #ffffff;
background: #D1CAAF;
border-color: #D1CAAF;
text-decoration: none;
}

4.4 在文章中需要分頁的地方輸入<!–nextpage–>

WordPress 安裝筆記 – 3.在文章中加入Facebook按鈕

3.連結FACEBOOK的「讚」和「發送」
3.1 把以下程式碼,加入index.php, archive.php, single.php中

<div id="fb-root"></div>
<script src="http://connect.facebook.net/zh_TW/all.js#appId=118406191585171&amp;xfbml=1"></script>
<fb:like href="<?php the_permalink() ?>" send="true" width="450" show_faces="true" font="" colorscheme="dark"></fb:like>

3.2 相關說明:facebook developer