<?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>สร้าง Shortcode Archives - รับทำเว็บไซต์ ออกแบบเว็บไซต์ รับทำเว็บไซต์ด้วย WordPress เว็บแอพพลิเคชั่น รับทำแอพ ร้านค้าออนไลน์ e-commerce ระบบอินทราเน็ต ดูแลเว็บไซต์ จดโดเมน โฮสติ้ง</title>
	<atom:link href="https://www.websitelob.com/tag/%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-shortcode/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.websitelob.com/tag/สร้าง-shortcode/</link>
	<description>รับทำเว็บไซต์ ออกแบบเว็บไซต์ รับทำเว็บไซต์ด้วย Wordpress  เว็บแอพพลิเคชั่น รับทำแอพ  ร้านค้าออนไลน์ e-commerce ระบบอินทราเน็ต ดูแลเว็บไซต์ จดโดเมน โฮสติ้ง</description>
	<lastBuildDate>Tue, 24 Jun 2025 06:18:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>

<image>
	<url>https://www.websitelob.com/2025/wp-content/uploads/2020/05/favicon-45x45.png</url>
	<title>สร้าง Shortcode Archives - รับทำเว็บไซต์ ออกแบบเว็บไซต์ รับทำเว็บไซต์ด้วย WordPress เว็บแอพพลิเคชั่น รับทำแอพ ร้านค้าออนไลน์ e-commerce ระบบอินทราเน็ต ดูแลเว็บไซต์ จดโดเมน โฮสติ้ง</title>
	<link>https://www.websitelob.com/tag/สร้าง-shortcode/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>สร้าง Short code แบบง่ายๆ บน WordPress</title>
		<link>https://www.websitelob.com/%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-short-code-%e0%b9%81%e0%b8%9a%e0%b8%9a%e0%b8%87%e0%b9%88%e0%b8%b2%e0%b8%a2%e0%b9%86-%e0%b8%9a%e0%b8%99-wordpress/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 12 Jan 2021 04:59:37 +0000</pubDate>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[website-tip]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[สร้าง Shortcode]]></category>
		<guid isPermaLink="false">https://www.websitelob.com/2025/wordpress-widgets-%e0%b8%84%e0%b8%b7%e0%b8%ad-copy/</guid>

					<description><![CDATA[<p>ShortCode ใน WordPress คือการที่เราสร้าง Code สั้นๆมาใช้งาน ตัวอย่างเช่น [ShortCode555] แล้วพิมพ์ code นี้เข้าไปใน content พอเราดูการแสดงผลจะแสดงผลลัพธ์ของเนื้อหาที่เราตั้งไว้ การสร้างก็ง่ายๆ แต่อาจจะต้องมีความรู้ PHP ด้วยนะครับ</p>
<p>The post <a href="https://www.websitelob.com/%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-short-code-%e0%b9%81%e0%b8%9a%e0%b8%9a%e0%b8%87%e0%b9%88%e0%b8%b2%e0%b8%a2%e0%b9%86-%e0%b8%9a%e0%b8%99-wordpress/">สร้าง Short code แบบง่ายๆ บน WordPress</a> appeared first on <a href="https://www.websitelob.com">รับทำเว็บไซต์ ออกแบบเว็บไซต์ รับทำเว็บไซต์ด้วย WordPress  เว็บแอพพลิเคชั่น รับทำแอพ  ร้านค้าออนไลน์ e-commerce ระบบอินทราเน็ต ดูแลเว็บไซต์ จดโดเมน โฮสติ้ง</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>ShortCode ใน WordPress คือการที่เราสร้าง Code สั้นๆมาใช้งาน ตัวอย่างเช่น <strong>[ShortCode555] แล้วพิมพ์ code นี้เข้าไปใน content พอเราดูการแสดงผลจะแสดงผลลัพธ์ของเนื้อหาที่เราตั้งไว้</strong></p>



<p>การสร้างก็ง่ายๆ แต่อาจจะต้องมีความรู้ PHP ด้วยนะครับ</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://www.websitelob.com/2025/wp-content/uploads/2021/01/shortcode.jpg"><img fetchpriority="high" decoding="async" width="767" height="450" src="https://www.websitelob.com/2025/wp-content/uploads/2021/01/shortcode.jpg" alt="" class="wp-image-1470" srcset="https://www.websitelob.com/2025/wp-content/uploads/2021/01/shortcode.jpg 767w, https://www.websitelob.com/2025/wp-content/uploads/2021/01/shortcode-300x176.jpg 300w" sizes="(max-width: 767px) 100vw, 767px" /></a></figure></div>


<p></p>



<p><strong>วิธีการ</strong></p>



<p>เข้าไปแก้ไขไฟล์ functions.php ภายใต้ Theme ที่เราใช้งานอยู่</p>



<p>พิมพ์ Code ต่อท้ายไฟล์</p>



<p><em>ตังอย่างนี้จะแสดงปีผลปัจจุบันขึ้นมา เพื่อใช้ในข้อความ copyright ตรง footer</em></p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">function year_shortcode() {
  $year = date('Y');
  return $year;
}
add_shortcode('year', 'year_shortcode');</pre></div>



<p><strong>function year_shortcode()</strong> ทั้งชื่อ Function ที่เราใช้เรียก</p>



<p>ภายใน<strong> { }</strong> คือ code โปรแกรม PHP สุดท้าย code ให้ return ค่าออกมา</p>



<p>&nbsp;</p>



<p><strong>add_shortcode(&#8216;year&#8217;, &#8216;year_shortcode&#8217;);</strong> ส่วนนี้ก็เป็นการ Add Short Code</p>



<p><strong>year</strong> คือ ชื่อ Short Code</p>



<p>เวลาเรียกใช้งานการเพียงใส่ค่า [year] แบบนี้การแสดงผลก็จะเป็นตัวเลขปี ค.ศ. 4 หลัก ( 2021 )</p>



<p>ง่ายๆแบบนี้ลองเอา code ไปพัฒนาต่อกันดูนะครับ</p>



<p>&nbsp;</p>
<p>The post <a href="https://www.websitelob.com/%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-short-code-%e0%b9%81%e0%b8%9a%e0%b8%9a%e0%b8%87%e0%b9%88%e0%b8%b2%e0%b8%a2%e0%b9%86-%e0%b8%9a%e0%b8%99-wordpress/">สร้าง Short code แบบง่ายๆ บน WordPress</a> appeared first on <a href="https://www.websitelob.com">รับทำเว็บไซต์ ออกแบบเว็บไซต์ รับทำเว็บไซต์ด้วย WordPress  เว็บแอพพลิเคชั่น รับทำแอพ  ร้านค้าออนไลน์ e-commerce ระบบอินทราเน็ต ดูแลเว็บไซต์ จดโดเมน โฮสติ้ง</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
