<?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>Victor Hung%27s Diary</title>
	<atom:link href="https://taskinghouse.com/posts/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>https://taskinghouse.com</link>
	<description></description>
	<lastBuildDate>Thu, 04 Jul 2019 07:30:44 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.1</generator>

<image>
	<url>https://taskinghouse.com/wp-content/uploads/2018/05/cropped-favicon.png</url>
	<title>WordPress &#8211; TaskingHouse</title>
	<link>https://taskinghouse.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>「教學」設定 WooCommerce 超商取貨最大重量/數量限制</title>
		<link>https://taskinghouse.com/posts/woocommerce-shipping-methods-cvs-based-on-weight-or-quantity/</link>
		
		<dc:creator><![CDATA[Victor Hung]]></dc:creator>
		<pubDate>Thu, 04 Jul 2019 12:00:07 +0000</pubDate>
				<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[教學]]></category>
		<category><![CDATA[數量限制]]></category>
		<category><![CDATA[超商取貨]]></category>
		<category><![CDATA[重量限制]]></category>
		<guid isPermaLink="false">https://diary.taskinghouse.com/?p=3169</guid>

					<description><![CDATA[<p>無論是 7-11 統一超商或全家便利商店的店到店寄貨規範，都有限制尺寸長寬高相加必須小於 105 公分，且單邊長度小於 45 公分，而總重量不得超過 5 公斤。...</p>
<p>這篇文章 <a rel="nofollow" href="https://taskinghouse.com/posts/woocommerce-shipping-methods-cvs-based-on-weight-or-quantity/">「教學」設定 WooCommerce 超商取貨最大重量/數量限制</a> 最早出現於 <a rel="nofollow" href="https://taskinghouse.com">TaskingHouse</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>無論是 7-11 統一超商或全家便利商店的店到店寄貨規範，都有限制尺寸長寬高相加必須小於 105 公分，且單邊長度小於 45 公分，而總重量不得超過 5 公斤。除了透過設定商品運送類別，決定是否可以使用指定的運送方式外，本文教你透過外掛設定超商取貨（或其他運送方式）的重量/數量上限，當顧客購買超過指定重量/數量時，就無法選擇超商取貨（或其他運送方式）</p>
<p>首先安裝 <strong>ELEX Hide WooCommerce Shipping Methods Plugin</strong> 這套外掛<br />
<a href="https://elextensions.com/plugin/conditionally-hide-woocommerce-shipping-methods-plugin/" target="_blank" rel="noopener">https://elextensions.com/plugin/conditionally-hide-woocommerce-shipping-methods-plugin/</a></p>
<p>外掛的設定頁面很簡單，只有建立規則，以及管理規則兩個頁籤。我們在建立規則的頁籤設定篩選器：</p>
<ol>
<li>Shipping Class 選擇運送類別，因為我們是建立針對所有商品都適用的全域設定則不用選。</li>
<li>Order Weight 訂單重量限制，我們依照超商限制，設定為大於等於 5 公斤。</li>
<li>Shipping Methods 運送方式，我們可以選擇「超商取貨」以外的所有運送方式。</li>
</ol>
<p>設定完成後按儲存並繼續</p>
<p><img decoding="async" src="https://taskinghouse.com/wp-content/uploads/2019/07/woocommerce-shipping-methods-cvs-based-on-weight-or-quantity-01.png" alt="" /></p>
<p>第二步隱藏運送方式，我們設定的規則就是超過 5 公斤不能超商取貨，因此在這裡我們將所有超商取貨的運送方式都加入。規則名稱僅供識別，隨意自訂就可以了，留空系統則會自動產生。</p>
<p><img decoding="async" src="https://taskinghouse.com/wp-content/uploads/2019/07/woocommerce-shipping-methods-cvs-based-on-weight-or-quantity-02.png" alt="" /></p>
<p>接著因為是透過重量來判斷，因此商品必須設定重量，可以在商品資料中的運送方式頁籤找到填寫重量的欄位。</p>
<p><img decoding="async" src="https://taskinghouse.com/wp-content/uploads/2019/07/woocommerce-shipping-methods-cvs-based-on-weight-or-quantity-03.png" alt="" /></p>
<p>設定完成後到前台實際測試，設定 500 公克的商品，購買 5 件訂單重量 4.5 公斤，此時可以選擇超商取貨。</p>
<p><img decoding="async" src="https://taskinghouse.com/wp-content/uploads/2019/07/woocommerce-shipping-methods-cvs-based-on-weight-or-quantity-04.png" alt="" /></p>
<p>將購買數量加到 6 件，此時訂單重量 5 公斤觸發條件，超商取貨的選項自動隱藏。</p>
<p><img decoding="async" src="https://taskinghouse.com/wp-content/uploads/2019/07/woocommerce-shipping-methods-cvs-based-on-weight-or-quantity-05.png" alt="" /></p>
<p>以上就是設定透過商品重量決定是否支援運送方式的方法，如果你販售的商品的體積，假設超過三件就會大於超商的體積限制，這時也可以透過上面的方法來設定規則。例如：</p>
<p>超商取貨商品限購 3 件，那麼我們設定訂單總重限制 4 公斤，商品重量設定 1 公斤，這樣顧客若選擇超過 3 件商品，就無法使用超商取貨。</p>
<p>如果不同的商品有不同的規則，請將相同規則的商品加入同一個運送類別，就可以在第一步預先設定 Shipping Class 運送類別，針對不同的商品使用不同的重量限制規則。</p>
<p>這篇文章 <a rel="nofollow" href="https://taskinghouse.com/posts/woocommerce-shipping-methods-cvs-based-on-weight-or-quantity/">「教學」設定 WooCommerce 超商取貨最大重量/數量限制</a> 最早出現於 <a rel="nofollow" href="https://taskinghouse.com">TaskingHouse</a>。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>「教學」Plesk 調整 Nginx 解決 WordPress 固定網址 404 錯誤</title>
		<link>https://taskinghouse.com/posts/adjusts-nginx-settings-to-fix-wordpress-permalink-404-error-with-plesk/</link>
		
		<dc:creator><![CDATA[Victor Hung]]></dc:creator>
		<pubDate>Fri, 31 Aug 2018 16:00:18 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[教學]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[index.php]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Permalink]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[固定網址]]></category>
		<guid isPermaLink="false">https://diary.taskinghouse.com/?p=2110</guid>

					<description><![CDATA[<p>Nginx 有低資源、低消耗、高效能等優點，但一般網路關於 WordPress 的架站教學、虛擬主機快速安裝 WordPress 的功能，通常都是預設使用 Ap...</p>
<p>這篇文章 <a rel="nofollow" href="https://taskinghouse.com/posts/adjusts-nginx-settings-to-fix-wordpress-permalink-404-error-with-plesk/">「教學」Plesk 調整 Nginx 解決 WordPress 固定網址 404 錯誤</a> 最早出現於 <a rel="nofollow" href="https://taskinghouse.com">TaskingHouse</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>Nginx 有低資源、低消耗、高效能等優點，但一般網路關於 WordPress 的架站教學、虛擬主機快速安裝 WordPress 的功能，通常都是預設使用 Apache。如果主機使用 Plesk 這樣的管理軟體，可以很輕鬆的透過 GUI 介面設定 PHP 版本，以及選擇使用 Nginx 或是 Apache 來作為負載均衡器。</p>
<p>本篇會使用到 Plesk 兩個設定頁面，首先點選 PHP 設定：</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-2111" src="https://taskinghouse.com/wp-content/uploads/2018/08/nginx-wordpress-404-menu.png" alt="" width="2048" height="1106" /></p>
<p>在 PHP 支援中選擇 PHP 版本以集運行 PHP 以 <code>FPM 應用程式 由 nginx 服務</code></p>
<p>此外有些主題或外掛會要求「PHP Max Input Vars」的數值，也可以在這個頁面的最下方設定，例如 Avada 主題建議的 5000 則是 <code>max_input_vars = 5000</code></p>
<p><img decoding="async" class="alignnone size-medium wp-image-2113" src="https://taskinghouse.com/wp-content/uploads/2018/08/nginx-wordpress-404-php.png" alt="" width="2048" height="1106" /></p>
<p>如果你的 WordPress 固定網址設定是使用「一般」或「數值式」那沒問題，但如果你是使用「文章名稱」或其他自訂結構，在你改為使用 Nginx 之後，Plesk 應該會將設定改為自訂結構並加入 <code>index.php</code> 字串在網址前面。</p>
<p>你可能跟筆者一樣覺得網址裡面顯示 <code>index.php</code> 實在是很醜，但如果你手動改回文章名稱，首頁沒問題，但其他頁面就會直接 404 找不到頁面，這就是因為 Nginx 的 Rewrite 功能沒有設定好所造成的錯誤，截止目前為止 WordPress 似乎都沒有辦法自動修正這個問題，而 Plesk 則是直接修改網址結構，有種便宜行事的感覺。</p>
<p><img decoding="async" class="alignnone size-full wp-image-2114" src="https://taskinghouse.com/wp-content/uploads/2018/08/nginx-wordpress-404-permalink.png" alt="" width="2048" height="1024" /></p>
<p>因此我們回到第一張圖的「Apache 與 nginx 設定」在最下方的「其他 Nginx 指令」輸入以下內容：</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2112" src="https://taskinghouse.com/wp-content/uploads/2018/08/nginx-wordpress-404-nginx.png" alt="" width="2048" height="1106" /></p>
<p><code>if (!-e $request_filename) {</code><br />
<code>	set $test P;</code><br />
<code>}</code><br />
<code>if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon|internal-nginx-static-location)) {</code><br />
<code>	set $test "${test}C";</code><br />
<code>}</code><br />
<code>if ($test = PC) {</code><br />
<code>	rewrite ^/(.*)$ /index.php?$1;</code><br />
<code>}</code></p>
<p>以上就能解決使用 Nginx 在 WordPress 固定網址所造成的 404 錯誤。</p>
<p>這篇文章 <a rel="nofollow" href="https://taskinghouse.com/posts/adjusts-nginx-settings-to-fix-wordpress-permalink-404-error-with-plesk/">「教學」Plesk 調整 Nginx 解決 WordPress 固定網址 404 錯誤</a> 最早出現於 <a rel="nofollow" href="https://taskinghouse.com">TaskingHouse</a>。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>「教學」使用 Poedit 抓取 Loco Translate 遺失的 WordPress 翻譯字串</title>
		<link>https://taskinghouse.com/posts/translate-wordpress-that-loco-translate-cant-with-poedit/</link>
		
		<dc:creator><![CDATA[Victor Hung]]></dc:creator>
		<pubDate>Thu, 30 Aug 2018 16:00:19 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[教學]]></category>
		<category><![CDATA[Loco Translate]]></category>
		<category><![CDATA[Poedit]]></category>
		<category><![CDATA[本地化]]></category>
		<category><![CDATA[翻譯]]></category>
		<guid isPermaLink="false">https://diary.taskinghouse.com/?p=2035</guid>

					<description><![CDATA[<p>如果你的部落格也是使用 WordPress 建置，因為大部分 WordPress 主題大多都是國外開發，除了 WordPress 核心已經翻譯成繁體中文的字串外...</p>
<p>這篇文章 <a rel="nofollow" href="https://taskinghouse.com/posts/translate-wordpress-that-loco-translate-cant-with-poedit/">「教學」使用 Poedit 抓取 Loco Translate 遺失的 WordPress 翻譯字串</a> 最早出現於 <a rel="nofollow" href="https://taskinghouse.com">TaskingHouse</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>如果你的部落格也是使用 WordPress 建置，因為大部分 WordPress 主題大多都是國外開發，除了 WordPress 核心已經翻譯成繁體中文的字串外，在網頁前台主題顯示的介面可能都會是英文的，如顯示全部分類的按鈕「Show All」這種，一般來說可以透過 Loco Translate 這套外掛，直接在後台將這些字串翻譯成中文。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2077" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-01.png" alt="" width="1200" height="630" /></p>
<p>不過有些字串在 Loco Translate 搜尋不到，根本無法翻譯。這種情形，通常是主題的作者沒有更新 WordPress 語言檔，因此在最新的主題版本中出現在字串，不在語言包的目錄中。可以注意一下目前主題的語言檔中總共有 1,075 筆字串。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2078" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-02.png" alt="" width="1200" height="630" /></p>
<p>先到 <a href="https://poedit.net/" target="_blank" rel="noopener">Poedit 的官網</a>免費下載 Poedit。開啟 Poedit 後點選「翻譯 WordPress 主題或外掛」，選擇「本電腦上」並匯入主題資料夾。這邊可以直接將主題資料夾拖曳到白色區域中，注意是「主題資料夾」不是一般在 WordPress 後台上傳的「壓縮安裝檔」。</p>
<p>如果你的主題是在 ThemeForest 購買的，可以先到 <a class="global-header-dropdown__link " href="https://themeforest.net/downloads" target="_blank" rel="noopener"><span class="global-header-dropdown__link-text">Downloads</span></a> 頁面，在主題右邊下載按鈕選擇「Installable WordPress file only」將下載的壓縮安裝檔解開，這個資料夾就是我們要的。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2079" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-03.png" alt="" width="1200" height="738" /></p>
<p>如果網站上的主題，已經使用 Loco Translate 翻譯了一些字串，那麼就沒有必要重頭開始翻譯，因此我們在 Poedit 選擇「建立 POT」</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2080" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-04.png" alt="" width="1200" height="738" /></p>
<p>Poedit 將會分析 WordPress 主題或外掛的程式碼，並抽出可翻譯的字串，並將其合併製作成 POT 語言檔。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2081" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-05.png" alt="" width="1200" height="630" /></p>
<p>預設的儲存路徑是主題資料夾中的「languages」，按下儲存，覆蓋原本 POT 語言檔。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2082" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-06.png" alt="" width="1200" height="739" /></p>
<p>這個新的 POT 語言檔包含了主題中所有可翻譯的字串。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2083" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-07.png" alt="" width="1200" height="630" /></p>
<p>我們將這個檔案透過 FTP 上傳到網站目錄相對的位置，也就是網頁目錄 &gt; wp-content &gt; 主題資料夾 &gt; languages，取代原本的 POT 語言檔。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2084" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-08.png" alt="" width="1200" height="630" /></p>
<p>接著我們回到後台的 Loco Translate，可以看到還是只有 1075 筆字串，不用擔心，直接按下「同步」</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2085" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-09.png" alt="" width="1200" height="630" /></p>
<p>Loco Translate 從新的 POT 語言檔抓取字串，新增了 436 筆字串，同時也淘汰 36 筆字串。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2086" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-10.png" alt="" width="1200" height="630" /></p>
<p>重新搜尋，已經可以找到剛剛要翻譯的字串</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2087" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-11.png" alt="" width="1200" height="630" /></p>
<p>翻譯完成，儲存，前台正確顯示。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2088" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-12.png" alt="" width="1200" height="630" /></p>
<p>有時候同個字串會在很多地方出現，例如「Search」這個字串，因為搜尋功能可能是網頁前台文章的搜尋、可能是網頁後台 Theme Option 的搜尋，這個時候我們可以從 Loco Translate 的「程式碼」頁籤確認每個字串的位置。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2089" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-13.png" alt="" width="1200" height="630" /></p>
<p>這篇文章 <a rel="nofollow" href="https://taskinghouse.com/posts/translate-wordpress-that-loco-translate-cant-with-poedit/">「教學」使用 Poedit 抓取 Loco Translate 遺失的 WordPress 翻譯字串</a> 最早出現於 <a rel="nofollow" href="https://taskinghouse.com">TaskingHouse</a>。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
