<?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>hieudt's blog &#187; filter</title>
	<atom:link href="http://hieudt.info/tag/filter/feed/" rel="self" type="application/rss+xml" />
	<link>http://hieudt.info</link>
	<description>WordPress and Symbian UIQ3</description>
	<lastBuildDate>Sat, 08 May 2010 01:05:46 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Plugin tạo watermark cho ảnh trong WordPress</title>
		<link>http://hieudt.info/wp-plugins/viet-nam-plugin-tao-watermark-cho-anh-trong-wordpress/</link>
		<comments>http://hieudt.info/wp-plugins/viet-nam-plugin-tao-watermark-cho-anh-trong-wordpress/#comments</comments>
		<pubDate>Sat, 08 May 2010 01:05:46 +0000</pubDate>
		<dc:creator>hieudt</dc:creator>
				<category><![CDATA[WP Plugins]]></category>
		<category><![CDATA[WP Tips-Tricks]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[fix code]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[watermark]]></category>

		<guid isPermaLink="false">http://hieudt.info/?p=1250</guid>
		<description><![CDATA[Watermark là một ảnh nhỏ (thường là file GIF hay PNG trong suốt) như ảnh logo hoặc một đoạn text ghi địa chỉ trang web được đóng dấu (in chìm) lên các bức ảnh của riêng bạn để ghi lại dấu ấn. Cách làm này từ xưa đã được khá nhiều webmaster sử dụng để [...]]]></description>
			<content:encoded><![CDATA[<p>Watermark là một ảnh nhỏ (thường là file GIF hay PNG trong suốt) như ảnh logo hoặc một đoạn  text ghi địa chỉ trang web được đóng dấu (in chìm) lên các bức ảnh của riêng bạn để ghi lại dấu ấn. Cách làm này từ xưa đã được khá nhiều webmaster sử dụng để giữ bản quyền cho hình ảnh của mình, tránh bị sao chép mà ko ghi rõ nguồn gốc.</p>
<p>Mấy hôm nay nghiên cứu vụ watermark này cho khách hàng, tôi đã tìm được một plugin khá hay tên là <a href="http://www.wp-watermark.com/">Marekki’s Watermark</a>. Plugin này có chức năng tạo watermark cho các file ảnh mà bạn upload lên host khi viết bài, lưu ý là bạn phải dùng công cụ upload ảnh của WordPress thì mới có tác dụng. Tuy ra đời khá lâu (từ năm 2007, lúc WordPress chỉ mới tới phiên bản 2.3) nhưng plugin này vẫn chạy tốt trên WordPress 2.9.x.<span id="more-1250"></span></p>
<div id="attachment_1251" class="wp-caption aligncenter" style="width: 310px"><a class="highslide-image" onclick="return hs.expand(this);" href="http://hieudt.info/media/2010/05/wp-watermark.png"><img class="size-medium wp-image-1251 " title="wp-watermark" src="http://hieudt.info/media/2010/05/wp-watermark-300x222.png" alt="" width="300" height="222" /></a><p class="wp-caption-text">Giao diện của plugin</p></div>
<p>Một nhược điểm của Marekki’s Watermark từ khi có WordPress 2.7 là lúc cài đặt, bạn phải tự tay sửa file /wp-admin/includes/media.php , vì file này nằm trong thư mục wp-admin nên mỗi khi bạn update lên phiên bản mới của WordPress thì file này bị chép đè và bạn phải sửa lại nó, rất bất tiện và tốn thời gian.</p>
<p>Sau một hồi nghiên cứu thì tôi đã tìm được cách khắc phục nhược điểm trên, bạn chỉ việc paste đoạn code dưới đây vào cuối file "watermark.php" là xong, ko cần phải sửa file /wp-admin/includes/media.php nữa.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> addwatermark<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   MM_Execute_WM<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">return</span> <span style="color: #000088;">$file</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_handle_upload'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'addwatermark'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Hy vọng với thủ thật này sẽ giúp các bạn thuận tiện hơn trong việc sử dụng plugin.</p>

	Tags: <a href="http://hieudt.info/tag/filter/" title="filter" rel="tag">filter</a>, <a href="http://hieudt.info/tag/fix-code/" title="fix code" rel="tag">fix code</a>, <a href="http://hieudt.info/tag/plugins/" title="plugins" rel="tag">plugins</a>, <a href="http://hieudt.info/tag/watermark/" title="watermark" rel="tag">watermark</a><br />
]]></content:encoded>
			<wfw:commentRss>http://hieudt.info/wp-plugins/viet-nam-plugin-tao-watermark-cho-anh-trong-wordpress/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>Tùy biến Smilies trong WordPress mà không cần dùng đến plugin</title>
		<link>http://hieudt.info/wp-tutorial/customize-wordpress-smilies-without-using-plugin/</link>
		<comments>http://hieudt.info/wp-tutorial/customize-wordpress-smilies-without-using-plugin/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 09:16:31 +0000</pubDate>
		<dc:creator>hieudt</dc:creator>
				<category><![CDATA[WP Tutorial]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[messenger]]></category>
		<category><![CDATA[smilies]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://hieudt.info/?p=1164</guid>
		<description><![CDATA[Có một điều mà tôi tin chắc rằng hầu như bất cứ ai dùng Internet hiện nay cũng đều sử dụng qua Smilies (Emoticons) để diễn tả cảm xúc của mình, nhất là khi họ tán gẫu (chat chit) hay thảo luận trên các diễn đàn. Ngoài nhiệm vụ thể hiện cảm xúc, smilies còn [...]]]></description>
			<content:encoded><![CDATA[<p>Có một điều mà tôi tin chắc rằng hầu như bất cứ ai dùng Internet hiện nay cũng đều sử dụng qua Smilies (Emoticons) để diễn tả cảm xúc của mình, nhất là khi họ tán gẫu (chat chit) hay thảo luận trên các diễn đàn.</p>
<p>Ngoài nhiệm vụ thể hiện cảm xúc, smilies còn làm tăng thêm tính sinh động, hài hước cho ý kiến của bạn, bởi thế nên smilies ngày càng phổ biến, bạn vào 10 blog thì hết 8 blog có sử dụng smilies, trong đó có blog của tôi. <img src='http://hieudt.info/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Quay lại với WordPress của chúng ta, tuy được xếp hạng ở top đầu trong số các blog platform hiện nay nhưng WordPress lại có hệ thống smilies khá ít (khoảng 22 icon) và không cho phép người dùng mở rộng thêm. Nếu đem so sánh thì bạn sẽ thấy smilies của WordPress không sinh động và đẹp mắt bằng smilies của các ứng dụng chat (IM), trong khi người dùng thì lại rất hay sử dụng smilies của IM nên có thể nói đây là một yếu điểm của WordPress vì đã không cho phép người dùng tùy biến smilies.</p>
<p>Nhưng không sao, vẫn có cách các bạn ạ. Sau một thời gian nghiên cứu về cách hiển thị smilies trong WordPress, tôi đã tìm ra cách khắc phục nhược điểm trên, nói đúng hơn là cách tùy biến smilies theo ý riêng mà không cần dùng đến plugin \:D/ .</p>
<p>Cách làm rất đơn giản, đảm bảo bạn chỉ mất khoảng 15&#039; là xong ngay. Còn bây giờ mời bạn sang trang 2 để cùng tôi tìm hiểu tiếp nhé! <img src='http://hieudt.info/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>

	Tags: <a href="http://hieudt.info/tag/filter/" title="filter" rel="tag">filter</a>, <a href="http://hieudt.info/tag/icons/" title="icons" rel="tag">icons</a>, <a href="http://hieudt.info/tag/messenger/" title="messenger" rel="tag">messenger</a>, <a href="http://hieudt.info/tag/smilies/" title="smilies" rel="tag">smilies</a>, <a href="http://hieudt.info/tag/tutorial/" title="tutorial" rel="tag">tutorial</a>, <a href="http://hieudt.info/tag/wordpress/" title="wordpress" rel="tag">wordpress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://hieudt.info/wp-tutorial/customize-wordpress-smilies-without-using-plugin/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Chèn link riêng vào menu Page của WordPress</title>
		<link>http://hieudt.info/wp-tips/adding-custom-links-to-wordpress-page-menu/</link>
		<comments>http://hieudt.info/wp-tips/adding-custom-links-to-wordpress-page-menu/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 08:01:53 +0000</pubDate>
		<dc:creator>hieudt</dc:creator>
				<category><![CDATA[WP Tips-Tricks]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://hieudt.info/?p=1160</guid>
		<description><![CDATA[Trước đây có một số bạn hỏi tôi cách chèn thêm link riêng (ví dụ như link đến forum) vào menu Page của WordPress thì làm thế nào bởi WordPress không hỗ trợ chúng ta làm việc đó trong WP-Admin. Tất nhiên là nếu chịu khó suy nghĩ thì ta vẫn có thể tìm ra [...]]]></description>
			<content:encoded><![CDATA[<p>Trước đây có một số bạn hỏi tôi cách chèn thêm link riêng (ví dụ như link đến forum) vào menu Page của WordPress thì làm thế nào bởi WordPress không hỗ trợ chúng ta làm việc đó trong WP-Admin. Tất nhiên là nếu chịu khó suy nghĩ thì ta vẫn có thể tìm ra cách bởi các menu ấy chẳng qua là code HTML được hàm wp_list_pages() của WordPress xuất ra dựa trên danh sách các Page hiện có trong blog của bạn.</p>
<p>Cách đơn giản nhất để làm chuyện này là mở file header.php của theme mà bạn đang dùng sau đó thêm code HTML vào bên dưới hàm wp_list_pages().<br />
<img src="http://hieudt.info/media/2009/03/customlinks.png" alt="chèn link ngoài vào menu page" width="607" height="74" class="alignleft size-full wp-image-1161" /></p>
<p>Cách thứ hai là bạn dùng một hàm php để "thọc" vào kết quả trả về của hàm wp_list_pages() bằng cách chèn đoạn code dưới đây vào file functions.php</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> add_custom_links<span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;http://hieudt.info/forum/&quot;&gt;Forum&lt;/a&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;http://twitter.com/hieudt/&quot;&gt;My Twitter&lt;/a&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_list_pages'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'add_custom_links'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Một số lưu ý:</strong><br />
1) Nếu không thích chèn code vào theme thì bạn có thể chèn vào plugin nào đó cũng được nhưng bắt buộc phải đặt code vào giữa khối <span class="highlight">&lt;?php ... ?&gt;</span>.<br />
2) Ví dụ ở trên chỉ dùng để minh họa, khi sử dụng bạn nên sửa lại theo ý riêng của mình.</p>
<p>Hy vọng bài viết này sẽ giúp ích cho nhiều bạn. Nếu bạn còn có cách nào khác hoặc biết plugin làm được chuyện này thì hoan nghênh bạn chia sẻ với mọi người nhé! <img src='http://hieudt.info/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

	Tags: <a href="http://hieudt.info/tag/filter/" title="filter" rel="tag">filter</a>, <a href="http://hieudt.info/tag/tips/" title="tips" rel="tag">tips</a>, <a href="http://hieudt.info/tag/wordpress/" title="wordpress" rel="tag">wordpress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://hieudt.info/wp-tips/adding-custom-links-to-wordpress-page-menu/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>WP Tip &#8211; Exclude pages from search results</title>
		<link>http://hieudt.info/wp-tips/wp-tip-exclude-pages-from-search-results/</link>
		<comments>http://hieudt.info/wp-tips/wp-tip-exclude-pages-from-search-results/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 06:32:49 +0000</pubDate>
		<dc:creator>hieudt</dc:creator>
				<category><![CDATA[WP Tips-Tricks]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://hieudt.info/?p=384</guid>
		<description><![CDATA[If you intend to exclude pages from search results, you can use the Simply-Exclude plugin. However, another solution that works pretty well is to add a filter in functions.php to only include posts categories instead of excluding pages from search results: 1 2 3 4 5 6 7 function mySearchPostsFilter&#40;$query&#41; &#123; if &#40;$query-&#62;is_search&#40;&#41;&#41; &#123; $query-&#62;set&#40;'cat','12,14,16,17,18'&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>If you intend to exclude pages from search results, you can use the <a href="http://www.codehooligans.com/2008/04/27/simply-exclude-plugin/" target="_blank">Simply-Exclude plugin</a>. However, another solution that works pretty well is to add a filter in <strong>functions.php</strong> to only include posts categories instead of excluding pages from search results:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mySearchPostsFilter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_search</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cat'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'12,14,16,17,18'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// your category IDs</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$query</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pre_get_posts'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mySearchPostsFilter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Just replace the posts category IDs (’12,14,16,17,18′) by your owns and it should work. That’s all!</p>

	Tags: <a href="http://hieudt.info/tag/filter/" title="filter" rel="tag">filter</a>, <a href="http://hieudt.info/tag/tips/" title="tips" rel="tag">tips</a>, <a href="http://hieudt.info/tag/wordpress/" title="wordpress" rel="tag">wordpress</a><br />
]]></content:encoded>
			<wfw:commentRss>http://hieudt.info/wp-tips/wp-tip-exclude-pages-from-search-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

