<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>艾德的部落格天空 &#187; Widget Logic</title>
	<atom:link href="http://edblog.net/archives/tag/widget-logic/feed" rel="self" type="application/rss+xml" />
	<link>http://edblog.net</link>
	<description>亂寫、亂拍、亂來。 --- 持續亂改更新中 ---</description>
	<lastBuildDate>Mon, 05 Dec 2011 08:03:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>側邊欄模組活用-Widget Logic</title>
		<link>http://edblog.net/archives/2063</link>
		<comments>http://edblog.net/archives/2063#comments</comments>
		<pubDate>Wed, 15 Jul 2009 02:33:27 +0000</pubDate>
		<dc:creator>Eduardo</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Widget Logic]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[外掛]]></category>

		<guid isPermaLink="false">http://edblog.net/?p=2063</guid>
		<description><![CDATA[以前，在設計佈景時，若要判斷在首頁、單篇文章頁面、分類頁面、搜尋頁面，都得自己在sidebar.php裡面寫判斷，變成若使用模組，就沒有辦法這樣控制。當然，外掛是無敵的XD，Widget Logic可以解決這樣的問題。下載Widget Logic。 上傳 widget-logic.php 到 /wp-content/plugins/ 再到 plugin 啟用該外掛 模組(Widget)裡面則會多了 Widget-Logic的功能 原本的模組內容沒有可以控制的選項，如下圖： 用了Widget logic，則多了一個Widget logic的設定，如下圖： 使用方法： is_home() &#8212; 在首頁出現 is_page() &#8212; 在所有分頁出現 is_page(&#8216;about&#8217;) &#8211;在 特定的分頁出現, 舉例為about頁面 is_archive() &#8212; 在彙整頁面出現 is_category &#8212; 在分類頁面出現 is_single() &#8212; 在所有單篇文章出現 is_single(&#8216;xx&#8217;) &#8212; 在特定的單篇文章出現, xx 可設定為文章id is_search () &#8212; 在搜尋結果頁出現 is_single() &#124;&#124; is_page()  &#8212; 在所有單篇文章以及所有分頁出現 列出一些方法給大家參考，這樣一來可以透過widget-logic來控制側邊欄的資料，在各個不同的頁面出現不同的內容，更達到CMS的效果。 Upload widget-logic.php to the [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="修改 WordPress 內建 widgets 的分類排序" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fedblog.net%2Farchives%2F1036&from=http%3A%2F%2Fedblog.net%2Farchives%2F2063">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/26/8084188.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">修改 WordPress 內建 widgets 的分類排序</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Plugin: WordPress 自動更新到最新版" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fedblog.net%2Farchives%2F1261&from=http%3A%2F%2Fedblog.net%2Farchives%2F2063">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/26/8078072.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Plugin: WordPress 自動更新到最新版</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yahoo Widget – 怪怪小玩意" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fedblog.net%2Farchives%2F646&from=http%3A%2F%2Fedblog.net%2Farchives%2F2063">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/26/8085198.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yahoo Widget – 怪怪小玩意</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress透過資料庫停用全部外掛" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fedblog.net%2Farchives%2F1965&from=http%3A%2F%2Fedblog.net%2Farchives%2F2063">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress透過資料庫停用全部外掛</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>以前，在設計佈景時，若要判斷在首頁、單篇文章頁面、分類頁面、搜尋頁面，都得自己在sidebar.php裡面寫判斷，變成若使用模組，就沒有辦法這樣控制。當然，外掛是無敵的XD，<a href="http://wordpress.org/extend/plugins/widget-logic/" target="_blank">Widget Logic</a>可以解決這樣的問題。下載<a href="http://wordpress.org/extend/plugins/widget-logic/" target="_blank">Widget Logic</a>。</p>
<ol>
<li>上傳 widget-logic.php 到 /wp-content/plugins/</li>
<li>再到 plugin 啟用該外掛</li>
<li>模組(Widget)裡面則會多了 Widget-Logic的功能</li>
</ol>
<p>原本的模組內容沒有可以控制的選項，如下圖：</p>
<p><img class="alignnone size-full wp-image-2065" title="widget-none" src="http://edblog.net/wp-content/uploads/2009/07/widget-none.png" alt="widget-none" width="300" height="235" /></p>
<p>用了Widget logic，則多了一個Widget logic的設定，如下圖：</p>
<p><img class="alignnone size-full wp-image-2066" title="widget-logic" src="http://edblog.net/wp-content/uploads/2009/07/widget-logic.png" alt="widget-logic" width="300" height="273" /></p>
<p>使用方法：</p>
<ol>
<li>is_home() &#8212; 在首頁出現</li>
<li>is_page() &#8212; 在所有分頁出現</li>
<li>is_page(&#8216;about&#8217;) &#8211;在 特定的分頁出現, 舉例為about頁面</li>
<li>is_archive() &#8212; 在彙整頁面出現</li>
<li>is_category &#8212; 在分類頁面出現</li>
<li>is_single() &#8212; 在所有單篇文章出現</li>
<li>is_single(&#8216;xx&#8217;) &#8212; 在特定的單篇文章出現, xx 可設定為文章id</li>
<li>is_search () &#8212; 在搜尋結果頁出現</li>
<li>is_single() || is_page()  &#8212; 在所有單篇文章以及所有分頁出現</li>
</ol>
<p>列出一些方法給大家參考，這樣一來可以透過widget-logic來控制側邊欄的資料，在各個不同的頁面出現不同的內容，更達到CMS的效果。</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">
<ol>
<li>Upload <code>widget-logic.php</code> to the <code>/wp-content/plugins/</code> directory</li>
<li>Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress</li>
<li>That&#8217;s it. All the configuring is in the usual widget admin interfac</li>
</ol>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="修改 WordPress 內建 widgets 的分類排序" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fedblog.net%2Farchives%2F1036&from=http%3A%2F%2Fedblog.net%2Farchives%2F2063">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/26/8084188.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">修改 WordPress 內建 widgets 的分類排序</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Plugin: WordPress 自動更新到最新版" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fedblog.net%2Farchives%2F1261&from=http%3A%2F%2Fedblog.net%2Farchives%2F2063">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/26/8078072.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Plugin: WordPress 自動更新到最新版</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yahoo Widget – 怪怪小玩意" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fedblog.net%2Farchives%2F646&from=http%3A%2F%2Fedblog.net%2Farchives%2F2063">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/26/8085198.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yahoo Widget – 怪怪小玩意</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress透過資料庫停用全部外掛" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fedblog.net%2Farchives%2F1965&from=http%3A%2F%2Fedblog.net%2Farchives%2F2063">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress透過資料庫停用全部外掛</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><script type="text/javascript"><!--
google_ad_client = "pub-0799927170161891";
/* 336x280, ??? 2009/4/8 */
google_ad_slot = "0733953819";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p> ]]></content:encoded>
			<wfw:commentRss>http://edblog.net/archives/2063/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

