<?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>WordPress custom fields - PurchaseTheme</title>
	<atom:link href="https://purchasetheme.com/tag/wordpress-custom-fields/feed/" rel="self" type="application/rss+xml" />
	<link>https://purchasetheme.com</link>
	<description>We Support Freelancers &#38; Small Businesses with FREE Tools &#38; Templates</description>
	<lastBuildDate>Wed, 05 Jun 2024 12:59:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.1</generator>

<image>
	<url>https://purchasetheme.com/wp-content/uploads/2023/09/favicon.png</url>
	<title>WordPress custom fields - PurchaseTheme</title>
	<link>https://purchasetheme.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to add custom field in post wordpress ?</title>
		<link>https://purchasetheme.com/how-to-add-custom-field-in-post-wordpress/</link>
					<comments>https://purchasetheme.com/how-to-add-custom-field-in-post-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 12 May 2024 07:05:10 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[add custom field to post WordPress]]></category>
		<category><![CDATA[add extra fields to WordPress post]]></category>
		<category><![CDATA[create custom fields in WordPress]]></category>
		<category><![CDATA[custom field CSS WordPress]]></category>
		<category><![CDATA[custom field filter WordPress post]]></category>
		<category><![CDATA[custom field options WordPress]]></category>
		<category><![CDATA[custom field search WordPress]]></category>
		<category><![CDATA[custom field WordPress tutorial]]></category>
		<category><![CDATA[custom metadata fields WordPress]]></category>
		<category><![CDATA[customize WordPress posts with fields]]></category>
		<category><![CDATA[Edit custom field WordPress]]></category>
		<category><![CDATA[export custom fields WordPress]]></category>
		<category><![CDATA[how to add custom field in WordPress post]]></category>
		<category><![CDATA[how to use custom field in WordPress page]]></category>
		<category><![CDATA[import custom fields WordPress]]></category>
		<category><![CDATA[manage custom fields WordPress]]></category>
		<category><![CDATA[using custom fields in WordPress]]></category>
		<category><![CDATA[WordPress advanced custom fields]]></category>
		<category><![CDATA[WordPress custom field date format]]></category>
		<category><![CDATA[WordPress custom field default value]]></category>
		<category><![CDATA[WordPress custom field display]]></category>
		<category><![CDATA[WordPress custom field image]]></category>
		<category><![CDATA[WordPress custom field plugin]]></category>
		<category><![CDATA[WordPress custom field shortcode]]></category>
		<category><![CDATA[WordPress custom field template]]></category>
		<category><![CDATA[WordPress custom field validation]]></category>
		<category><![CDATA[WordPress custom fields]]></category>
		<category><![CDATA[WordPress custom post types and fields]]></category>
		<category><![CDATA[WordPress post custom field array]]></category>
		<category><![CDATA[WordPress post meta]]></category>
		<guid isPermaLink="false">https://purchasetheme.com/?p=598</guid>

					<description><![CDATA[<p>Adding custom fields to WordPress posts is a common necessity, complementing the platform&#8217;s built-in features like tags and featured images. While, WordPress offers robust functionality, custom fields enhance it by accommodating additional information tailored to specific needs. This could include diverse content such as text, images, links, or more complex data. Utilizing the default custom...</p>
<p>The post <a href="https://purchasetheme.com/how-to-add-custom-field-in-post-wordpress/">How to add custom field in post wordpress ?</a> first appeared on <a href="https://purchasetheme.com">PurchaseTheme</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Adding custom fields to WordPress posts is a common necessity, complementing the platform&#8217;s built-in features like tags and featured images. </p>



<p>While, WordPress offers robust functionality, custom fields enhance it by accommodating additional information tailored to specific needs. This could include diverse content such as text, images, links, or more complex data. Utilizing the default custom field functionality in WordPress provides a flexible solution, enabling users to extend their site&#8217;s capabilities without the need for extensive coding or plugins. </p>



<p>Whether for personalization, integration with external systems, or enhancing user experience, custom fields are invaluable in enriching WordPress content beyond its default offerings.</p>



<p>You have to follow the below step to add the custom fields &amp; to get the custom field value in the code ( to get in the template files example header, footer, content, content top etc )</p>



<p><strong>Step 1</strong>: Login to wordpress Admin</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1001" height="655" src="https://purchasetheme.com/wp-content/uploads/2024/05/image.png" alt="" class="wp-image-599" srcset="https://purchasetheme.com/wp-content/uploads/2024/05/image.png 1001w, https://purchasetheme.com/wp-content/uploads/2024/05/image-300x196.png 300w, https://purchasetheme.com/wp-content/uploads/2024/05/image-768x503.png 768w" sizes="(max-width: 1001px) 100vw, 1001px" /></figure>



<p><strong>Step 2</strong>: Left menu &#8220;<strong>All Post</strong>&#8221; </p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="456" src="https://purchasetheme.com/wp-content/uploads/2024/05/image-1-1024x456.png" alt="" class="wp-image-600" srcset="https://purchasetheme.com/wp-content/uploads/2024/05/image-1-1024x456.png 1024w, https://purchasetheme.com/wp-content/uploads/2024/05/image-1-300x134.png 300w, https://purchasetheme.com/wp-content/uploads/2024/05/image-1-768x342.png 768w, https://purchasetheme.com/wp-content/uploads/2024/05/image-1.png 1265w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Step 3:</strong> Click on &#8220;Edit&#8221; button to edit the post and on which you want to add custom field</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="506" src="https://purchasetheme.com/wp-content/uploads/2024/05/image-2-1024x506.png" alt="" class="wp-image-601" srcset="https://purchasetheme.com/wp-content/uploads/2024/05/image-2-1024x506.png 1024w, https://purchasetheme.com/wp-content/uploads/2024/05/image-2-300x148.png 300w, https://purchasetheme.com/wp-content/uploads/2024/05/image-2-768x379.png 768w, https://purchasetheme.com/wp-content/uploads/2024/05/image-2.png 1314w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Step 4:</strong> Now, click on the right side top 3 dots, check below image indication</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="473" src="https://purchasetheme.com/wp-content/uploads/2024/05/image-3-1024x473.png" alt="" class="wp-image-602" srcset="https://purchasetheme.com/wp-content/uploads/2024/05/image-3-1024x473.png 1024w, https://purchasetheme.com/wp-content/uploads/2024/05/image-3-300x138.png 300w, https://purchasetheme.com/wp-content/uploads/2024/05/image-3-768x355.png 768w, https://purchasetheme.com/wp-content/uploads/2024/05/image-3-1536x709.png 1536w, https://purchasetheme.com/wp-content/uploads/2024/05/image-3.png 1891w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Step 5:</strong> Once you click on &#8220;<strong>Preferences</strong>&#8221; a pop will option and it will provide option to enable &#8220;<strong>Custom fields</strong>&#8221; </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="515" src="https://purchasetheme.com/wp-content/uploads/2024/05/image-4-1024x515.png" alt="" class="wp-image-603" srcset="https://purchasetheme.com/wp-content/uploads/2024/05/image-4-1024x515.png 1024w, https://purchasetheme.com/wp-content/uploads/2024/05/image-4-300x151.png 300w, https://purchasetheme.com/wp-content/uploads/2024/05/image-4-768x386.png 768w, https://purchasetheme.com/wp-content/uploads/2024/05/image-4-1536x772.png 1536w, https://purchasetheme.com/wp-content/uploads/2024/05/image-4.png 1657w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Step 6:</strong> Enable it and click on &#8220;Show &amp; Reload Page&#8221; button, a section to add the values will be appeared below:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="504" src="https://purchasetheme.com/wp-content/uploads/2024/05/image-5-1024x504.png" alt="" class="wp-image-604" srcset="https://purchasetheme.com/wp-content/uploads/2024/05/image-5-1024x504.png 1024w, https://purchasetheme.com/wp-content/uploads/2024/05/image-5-300x148.png 300w, https://purchasetheme.com/wp-content/uploads/2024/05/image-5-768x378.png 768w, https://purchasetheme.com/wp-content/uploads/2024/05/image-5-1536x756.png 1536w, https://purchasetheme.com/wp-content/uploads/2024/05/image-5.png 1721w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Step 7:</strong> Now, lets put the &#8220;Status&#8221; in the name input and in Value add &#8220;Active&#8221; for this hello world post.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="348" src="https://purchasetheme.com/wp-content/uploads/2024/05/image-6-1024x348.png" alt="" class="wp-image-605" srcset="https://purchasetheme.com/wp-content/uploads/2024/05/image-6-1024x348.png 1024w, https://purchasetheme.com/wp-content/uploads/2024/05/image-6-300x102.png 300w, https://purchasetheme.com/wp-content/uploads/2024/05/image-6-768x261.png 768w, https://purchasetheme.com/wp-content/uploads/2024/05/image-6.png 1467w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>You will also get the option to <strong>delete or update</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="409" src="https://purchasetheme.com/wp-content/uploads/2024/05/image-7-1024x409.png" alt="" class="wp-image-606" srcset="https://purchasetheme.com/wp-content/uploads/2024/05/image-7-1024x409.png 1024w, https://purchasetheme.com/wp-content/uploads/2024/05/image-7-300x120.png 300w, https://purchasetheme.com/wp-content/uploads/2024/05/image-7-768x307.png 768w, https://purchasetheme.com/wp-content/uploads/2024/05/image-7.png 1439w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>So, this how you are going to add the &#8220;Custom Field&#8221; Now, let us tell you how you are going to retrieve/get this field.</p>



<pre class="wp-block-code"><code>&lt;?php
  echo get_post_meta( get_the_ID(), 'Status', true ); 
  echo '&lt;br />';
  echo get_post_meta( get_the_ID(), 'date', true ); 
?>

From the array you can do it.

my_key - Your custom field name.</code></pre>



<pre class="wp-block-code"><code>$mykey_values = get_post_custom_values( 'my_key' );

foreach ( $mykey_values as $key => $value ) {
	echo "$key => $value ( 'my_key' )&lt;br />"; 
}

0 => First value ( 'my_key' )
1 => Second value ( 'my_key' )
2 => Third value ( 'my_key' )

If you still find any problem you can drop a comment and will surly get back to you in few hours. <strong>Also, you can drop us email at info@purchasetheme.com </strong>
</code></pre>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook_messenger" href="https://www.addtoany.com/add_to/facebook_messenger?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Messenger" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_google_gmail" href="https://www.addtoany.com/add_to/google_gmail?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Gmail" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_snapchat" href="https://www.addtoany.com/add_to/snapchat?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Snapchat" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_telegram" href="https://www.addtoany.com/add_to/telegram?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Telegram" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_outlook_com" href="https://www.addtoany.com/add_to/outlook_com?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Outlook.com" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_blogger" href="https://www.addtoany.com/add_to/blogger?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Blogger" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&amp;linkname=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fpurchasetheme.com%2Fhow-to-add-custom-field-in-post-wordpress%2F&#038;title=How%20to%20add%20custom%20field%20in%20post%20wordpress%20%3F" data-a2a-url="https://purchasetheme.com/how-to-add-custom-field-in-post-wordpress/" data-a2a-title="How to add custom field in post wordpress ?"></a></p><p>The post <a href="https://purchasetheme.com/how-to-add-custom-field-in-post-wordpress/">How to add custom field in post wordpress ?</a> first appeared on <a href="https://purchasetheme.com">PurchaseTheme</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://purchasetheme.com/how-to-add-custom-field-in-post-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
