<?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 API &#187; wordpress hacks</title>
	<atom:link href="http://wordpressapi.com/category/wordpress/wordpress-hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://wordpressapi.com</link>
	<description>Wordpress Tutorials, Tips, Code, Hacks, Themes, plugin, Developer Code book -Wordpress Code, Themes, Plugins, Tips, Tutorials, News, Releases, Designs, Hacks, Tricks, Blog</description>
	<lastBuildDate>Tue, 08 May 2012 17:37:16 +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>install and update the wordpress plugins without providing ftp access</title>
		<link>http://wordpressapi.com/2012/03/12/install-and-update-wordpress-plugins-without-providing-ftp-access/</link>
		<comments>http://wordpressapi.com/2012/03/12/install-and-update-wordpress-plugins-without-providing-ftp-access/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 18:15:50 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress api]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wordpress tutorials]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[wordpress plugins]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp hack]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=7038</guid>
		<description><![CDATA[http://wordpressapi.com/2012/03/12/install-and-update-wordpress-plugins-without-providing-ftp-access/I did so much R&#38;D about installing and updating the wordpress plugin without using ftp access. I got very nice trick to solve this issue. First you need to add the following code in your wp-config.php file. But this is &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2012/03/12/install-and-update-wordpress-plugins-without-providing-ftp-access/<p>I did so much R&amp;D about installing and updating the wordpress plugin without using ftp access. I got very nice trick to solve this issue.</p>
<p>First you need to add the following code in your wp-config.php file.</p>
<pre class="brush: php; title: ; notranslate">
define('FTP_USER', 'username');
define('FTP_PASS', 'mypassword');
define('FTP_HOST', '192.168.2.132');
define('FTP_SSL', false);
</pre>
<p>But this is old idea. If you dont want to add the ftp access in wp-config.php file then Just add the following line wp-config.php file.</p>
<pre class="brush: php; title: ; notranslate">

define('FS_METHOD', 'direct');
</pre>
<p><strong>Note: You need to give 755 permission to wp-content folder. Create the upgrade folder in wp-content folder.</strong></p>
<p>If still you are facing issue then give 777 permission to all wp-content folder.</p>
<p>For permission use following command</p>
<pre class="brush: php; title: ; notranslate">
cd your_wordpress_directory
sudo chown -R www-data wp-content
sudo chmod -R 755 wp-content
</pre>
<p><strong><code>More information:</code></strong></p>
<p>WordPress will try to write a temporary file to your <code>/wp-content</code> directory. If this succeeds, it compares the ownership of the file with it&#8217;s own uid, and if there is a match it will allow you to use the &#8216;direct&#8217; method of installing plugins, themes, or updates.</p>
<p>Now, if for some reason you do not want to rely on the automatic check for which filesystem method to use, you can define a constant, <code>'FS_METHOD'</code> in your <code>wp-config.php</code> file that is either <code>'direct' 'ssh', 'ftpext' or 'ftpsockets'</code> and it will use method. Keep in mind that if you set this to &#8216;direct&#8217; but your web user (the username under which your webs server runs) does not have proper write permissions, you will receive an error.</p>
<div id="attachment_7039" class="wp-caption alignnone<a href="http://wordpressapi.com/2012/03/12/install-and-update-wordpress-plugins-without-providing-ftp-access/install-and-update-the-wordpress-plugins-without-providing-ftp-access/" rel="attachment wp-att-7039"><img class="size-medium wp-image-7039" title="install and update the wordpress plugins without providing ftp access" src="http://images.wordpressapi.com/install-and-update-the-wordpress-plugins-without-providing-ftp-access-300x192.png" alt="install and update the wordpress plugins without providing ftp access" width="300" height="192" /></a><p class="wp-caption-text">install and update the wordpress plugins without providing ftp access</p></div>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2012/03/12/install-and-update-wordpress-plugins-without-providing-ftp-access/" title="how to install plugin in wordpress without ftp and ssh">how to install plugin in wordpress without ftp and ssh</a></li><li><a href="http://wordpressapi.com/2012/03/12/install-and-update-wordpress-plugins-without-providing-ftp-access/" title="wordpress ec2 site plugin install ftp access error">wordpress ec2 site plugin install ftp access error</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2012/03/12/install-and-update-wordpress-plugins-without-providing-ftp-access/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add Feedburner RSS feed email subscription form in wordpress without plugin</title>
		<link>http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/</link>
		<comments>http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 08:22:14 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wordpress news]]></category>
		<category><![CDATA[wordpress tutorials]]></category>
		<category><![CDATA[feedburner]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[subscription]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=7024</guid>
		<description><![CDATA[http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/Many blogger and people want to add the feedburner RSS feed email subscription form in there website. In this post I created very simple tutorial for this. What is RSS? The easiest way to receive latest posts from your favorite &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/<p>Many blogger and people want to add the feedburner RSS feed email subscription form in there website.<br />
In this post I created very simple tutorial for this.</p>
<p><strong>What is RSS?</strong></p>
<p>The easiest way to receive latest posts from your favorite blogs is to subscribe to RSS using feed readers such as Google Reader, Bloglines, NetVibes.<br />
RSS (means Really Simple Syndication) retrieves the latest content from the sites you are interested and pulls them into your feed reader where you can read them all in one location rather than visiting each site separately.</p>
<p><strong>What is FeedBurner?</strong></p>
<p>Most blogs have RSS feed which is detected automatically by commonly used feed readers when the blog URL is added to the reader.</p>
<p>&nbsp;</p>
<h3>Setting Up Your Feedburner Feed</h3>
<p>1.  Go to <a href="http://feedburner.google.com/">Feedburner</a> and sign in to Feedburner with your Google Account (<a href="https://www.google.com/accounts/NewAccount?continue=http%3A%2F%2Ffeedburner.google.com%2Ffb%2Fa%2Fmyfeeds&amp;service=feedburner">create a Google Account</a> first if you don’t have one!).</p>
<p>However, if you want to make it more obvious and easier for readers to subscribe using RSS, or want to know exactly how many people subscribe to your blog then the best option is to add a Feedburner RSS feed and email subscription to your blog.</p>
<p>&nbsp;</p>
<p>After creating feedburner account go to</p>
<p>1.  Click on the <strong>Publicize Tab</strong> &gt;<strong> Email Subscription</strong> in your Feedburner account and click on <strong>Activate</strong>.</p>
<p>2.   Copy the HTML code.</p>
<p><a href="http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/wordpress-rss-feed-subscription/" rel="attachment wp-att-7025"><img class="alignnone size-full wp-image-7025" title="wordpress-rss-feed-subscription" src="http://images.wordpressapi.com/wordpress-rss-feed-subscription.png" alt="" width="717" height="637" /></a></p>
<p>&nbsp;</p>
<p>After this go to wordpress admin panel and go to widget section and choose text widget.</p>
<p>Add a text widget to the desired sidebar by dragging it from the <strong>Available Widgets</strong> into the Sidebar area on the right.</p>
<p>The widget will automatically open — just add the HTML code for Feedburner email subscription, click <strong>Save</strong> and then <strong>Close</strong>.</p>
<p>&nbsp;</p>
<p>This widget will look as follows:</p>
<p><a href="http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/wp-email-subscription/" rel="attachment wp-att-7026"><img class="alignnone size-full wp-image-7026" title="wp-email-subscription" src="http://images.wordpressapi.com/wp-email-subscription.png" alt="" width="353" height="202" /></a></p>
<p>If you like this article then please subscribe my blog.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/" title="email subscription and feedburner in one plugin">email subscription and feedburner in one plugin</a></li><li><a href="http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/" title="feedburner email subscribe without plugin">feedburner email subscribe without plugin</a></li><li><a href="http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/" title="feedburner form plugins">feedburner form plugins</a></li><li><a href="http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/" title="rss without feedburner">rss without feedburner</a></li><li><a href="http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/" title="subscribe feedburner form plugin">subscribe feedburner form plugin</a></li><li><a href="http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/" title="wordpress plugin feedburner email subscribe 2012">wordpress plugin feedburner email subscribe 2012</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2012/03/08/add-feedburner-rss-feed-email-subscription-form-in-wordpress-without-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to implement the Jquery UI datepicker in wordpress</title>
		<link>http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/</link>
		<comments>http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 18:21:08 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress api]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[wordpress tutorials]]></category>
		<category><![CDATA[datepicker]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=7011</guid>
		<description><![CDATA[http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/How can use the Jquery UI in your wordpress theme and plugin using following code. For adding the datepicker in theme you need to just add the following code in functions.php file or plugin. For showing the datepicker control in &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/<p>How can use the Jquery UI in your wordpress theme and plugin using following code. For adding the datepicker in theme you need to just add the following code in functions.php file or plugin.</p>
<pre class="brush: php; title: ; notranslate">

add_action( 'init', 'wpapi_date_picker' );
function wpapi_date_picker() {
    wp_enqueue_script( 'jquery' );
    wp_enqueue_script( 'jquery-ui-core' );
    wp_enqueue_script( 'jquery-datepicker', 'http://jquery-ui.googlecode.com/svn/trunk/ui/jquery.ui.datepicker.js', array('jquery', 'jquery-ui-core' ) );
}

add_action( 'wp_footer', 'wpapi_print_scripts');
function wpapi_print_scripts() {
    ?&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    jQuery(document).ready(function() {
        jQuery('#datepicker').datepicker();
    })
&lt;/script&gt;
    &lt;?php
}
</pre>
<p>For showing the datepicker control in theme or plugin use following code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
jQuery(document).ready(function() {
    jQuery('#datepicker').datepicker({
        dateFormat : 'yy-mm-dd'
    });
});
&lt;/script&gt;
</pre>
<div id="attachment_7012" class="wp-caption alignnone<a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/wordpress-datepicker/" rel="attachment wp-att-7012"><img src="http://images.wordpressapi.com/wordpress-datepicker.jpg" alt="How to implement the Jquery UI datepicker in wordpress" title="How to implement the Jquery UI datepicker in wordpress" width="560" height="272" class="size-full wp-image-7012" /></a><p class="wp-caption-text">How to implement the Jquery UI datepicker in wordpress</p></div>
<p>If you have any issue for adding the datepicker control then please add comment or email me.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="how add datepicker in wordpress theme?">how add datepicker in wordpress theme?</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="wordpress search datepicker">wordpress search datepicker</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="wordpress jquery datepicker as search">wordpress jquery datepicker as search</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="wordpress jquery datepicker">wordpress jquery datepicker</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="use datepicker api in php application">use datepicker api in php application</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="jqueryui wordpress">jqueryui wordpress</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="jquery ui datepicker javascript php code">jquery ui datepicker javascript php code</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="how to protect not to be hidden fields in jquery datepicker javascript adding">how to protect not to be hidden fields in jquery datepicker javascript adding</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="How to implement the JqueryUI in HTML">How to implement the JqueryUI in HTML</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="how to implement jquery datepicker ruby">how to implement jquery datepicker ruby</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="how to implement a datepicker using javascript">how to implement a datepicker using javascript</a></li><li><a href="http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/" title="wordpress ui datepicker js in theme template">wordpress ui datepicker js in theme template</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2012/02/21/how-to-implement-the-jquery-ui-datepicker-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>add javascript and css files into wordpress theme</title>
		<link>http://wordpressapi.com/2012/02/06/add-javascript-and-css-files-into-wordpress-theme/</link>
		<comments>http://wordpressapi.com/2012/02/06/add-javascript-and-css-files-into-wordpress-theme/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 18:17:20 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress api]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wordpress tutorials]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=7004</guid>
		<description><![CDATA[http://wordpressapi.com/2012/02/06/add-javascript-and-css-files-into-wordpress-theme/Many developers want to add the javascript and css files into wordpress themes. You just need to add following code into functions.php file. You just need to replace Your theme name and javascript and css file name. Incoming search terms:newsletter &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2012/02/06/add-javascript-and-css-files-into-wordpress-theme/<p>Many developers want to add the javascript and css files into wordpress themes. You just need to add following code into functions.php file.</p>
<pre class="brush: php; title: ; notranslate">
// Register your javascript for properties
function admin_your_javascript(){
    global $post;
    if($post-&gt;post_type == 'post-type' &amp;&amp; is_admin()) {
        wp_enqueue_script('YOUR-JS', WP_CONTENT_URL . '/themes/YOUR-THEME/js/YOUR-JS.js');

    }
}
add_action('admin_print_scripts', 'admin_your_javascript');

// Register your styles for properties
function admin_your_styles(){
    global $post;
    if($post-&gt;post_type == 'post-type' &amp;&amp; is_admin()) {
        wp_enqueue_style('YOUR-CSS', WP_CONTENT_URL . '/themes/YOUR-THEME/css/YOUR-CSS.css');
    }
}
add_action('admin_print_styles', 'admin_your_styles');
</pre>
<p>You just need to replace Your theme name and javascript and css file name.</p>
<div id="attachment_7005" class="wp-caption alignnone<a href="http://wordpressapi.com/2012/02/06/add-javascript-and-css-files-into-wordpress-theme/wordpressapi-wp-css-js/" rel="attachment wp-att-7005"><img class="size-medium wp-image-7005" title="add javascript and css files into wordpress theme" src="http://images.wordpressapi.com/wordpressapi-wp-css-js-300x179.jpg" alt="add javascript and css files into wordpress theme" width="300" height="179" /></a><p class="wp-caption-text">add javascript and css files into wordpress theme</p></div>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2012/02/06/add-javascript-and-css-files-into-wordpress-theme/" title="newsletter wordpress plugin css">newsletter wordpress plugin css</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2012/02/06/add-javascript-and-css-files-into-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Show the comments from custom post type in wordpress</title>
		<link>http://wordpressapi.com/2012/01/25/show-the-comments-from-custom-post-type-in-wordpress/</link>
		<comments>http://wordpressapi.com/2012/01/25/show-the-comments-from-custom-post-type-in-wordpress/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 18:48:14 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=7000</guid>
		<description><![CDATA[http://wordpressapi.com/2012/01/25/show-the-comments-from-custom-post-type-in-wordpress/Some time we shows the posts and there comments in sidebar. But what to do for show the comments for custom post type. It&#8217;s not well documented, but according to the codex, you can pass a &#8216;post_type&#8217; variable in the &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2012/01/25/show-the-comments-from-custom-post-type-in-wordpress/<p>Some time we shows the posts and there comments in sidebar. But what to do for show the comments for custom post type.</p>
<p>It&#8217;s not well documented, but according to the codex, you can pass a &#8216;post_type&#8217; variable in the get_comments function.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
 $comments = get_comments('number=10&amp;status=approve&amp;post_type=YOUR_POST_TYPE');
foreach($comments as $comment) :

// comment loop code will go here

endforeach;
?&gt;
</pre>
<p>Note: This code only useful after wordpress 3.1 version.</p>
<div id="attachment_6862" class="wp-caption alignnone<a href="http://wordpressapi.com/2011/07/27/add-the-comment-preview-to-comment-box-without-wordpress-plugin/wordpress-comments-preview/" rel="attachment wp-att-6862"><img class="size-medium wp-image-6862" title="Show the comments from custom post type in wordpress" src="http://images.wordpressapi.com/wordpress-comments-preview-300x199.jpg" alt="Show the comments from custom post type in wordpress" width="300" height="199" /></a><p class="wp-caption-text">Show the comments from custom post type in wordpress</p></div>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2012/01/25/show-the-comments-from-custom-post-type-in-wordpress/" title="amazon wordpress plugin custom post type">amazon wordpress plugin custom post type</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2012/01/25/show-the-comments-from-custom-post-type-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Change uploaded image name to post slug during upload using variables</title>
		<link>http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/</link>
		<comments>http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 18:09:48 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wordpress hack]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=6993</guid>
		<description><![CDATA[http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/If you want to rename files during upload and set their names to the post slug the files are beeing attached to, plus some random characters (a simple incremental counter will de just fine) to make the filenames different. In &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/<p>If you want to  rename files during upload and set their names to the post slug the files are beeing attached to, plus some random characters (a simple incremental counter will de just fine) to make the filenames different.<br />
<div id="attachment_6994" class="wp-caption alignnone<a href="http://wordpressapi.com/?attachment_id=6994" rel="attachment wp-att-6994"><img src="http://images.wordpressapi.com/change-uploaded-image-name-to-post-slug-during-upload-using-variables-300x192.png" alt="Change uploaded image name to post slug during upload using variables" title="Change uploaded image name to post slug during upload using variables" width="300" height="192" class="size-medium wp-image-6994" /></a><p class="wp-caption-text">Change uploaded image name to post slug during upload using variables</p></div></p>
<p>In other words, if you are uploading/attaching images to the post whose page slug is &#8220;test-page-slug&#8221;, i&#8217;d like for the images to be renamed on the fly to test-page-slug-[C].[original_extension] — test-page-slug-1.jpg, test-page-slug-2.jpg etc (no matter what the original filenames were).</p>
<p>This is very easy. You just need to use following hook in functions.php file.</p>
<pre class="brush: php; title: ; notranslate">
function wp_modify_uploaded_file_names($image_name) {

    // Get the parent post ID, if there is one
    if( isset($_GET['post_id']) ) {
        $post_id = $_GET['post_id'];
    } elseif( isset($_POST['post_id']) ) {
        $post_id = $_POST['post_id'];
    }

    // Only do this if we got the post ID--otherwise they're probably in
    //  the media section rather than uploading an image from a post.
    if(is_numeric($post_id)) {

        // Get the post slug
        $post_obj = get_post($post_id);
        $post_slug = $post_obj-&gt;post_name;

        // If we found a slug
        if($post_slug) {

            $random_number = rand(10000,99999);
            $image_name['name'] = $post_slug . '-' . $random_number . '.jpg';

        }

    }

    return $image_name;

}
add_filter('wp_handle_upload_prefilter', 'wp_modify_uploaded_file_names', 1, 1);
</pre>
<p>This is very easy.<br />
if you have pretty permalinks enabled, so I&#8217;ve added a check to make sure there is a slug before renaming the file. You&#8217;ll also want to consider checking the file type, which I haven&#8217;t done here&#8211;I&#8217;ve just assumed it&#8217;s a jpg.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/" title="change upload image nem wordpress">change upload image nem wordpress</a></li><li><a href="http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/" title="$post_slug = $post_obj-&gt;post_name;">$post_slug = $post_obj-&gt;post_name;</a></li><li><a href="http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/" title="how can we change uploaded image name">how can we change uploaded image name</a></li><li><a href="http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/" title="how to upload and rename image in php">how to upload and rename image in php</a></li><li><a href="http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/" title="jmeter change filename post upload">jmeter change filename post upload</a></li><li><a href="http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/" title="wordpress api chm">wordpress api chm</a></li><li><a href="http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/" title="wordpress api post php 2012">wordpress api post php 2012</a></li><li><a href="http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/" title="wordpress plugin api database">wordpress plugin api database</a></li><li><a href="http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/" title="wordpress upload pictures into folder named by post slug">wordpress upload pictures into folder named by post slug</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2012/01/11/change-uploaded-image-name-to-post-slug-during-upload-using-variables/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Solved: qTranslate slug with Widget not working with pages</title>
		<link>http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/</link>
		<comments>http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 18:12:43 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp plugin]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=6990</guid>
		<description><![CDATA[http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/We just saw the issue with qtranslate slug with widget is not working for 0.5 version. URL is showing but URL is not opening and 404 page is opening. The problem was exactly at the function qTranslateSlug_filter_request inside de file &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/<p>We just saw the issue with qtranslate slug with widget is not working for 0.5 version. URL is showing but URL is not opening and 404 page is opening.</p>
<div id="attachment_6991" class="wp-caption alignnone<a href="http://wordpressapi.com/?attachment_id=6991" rel="attachment wp-att-6991"><img class="size-medium wp-image-6991" title="Solved: qTranslate slug with Widget not working with pages" src="http://images.wordpressapi.com/wordpress-language-translation-300x225.jpg" alt="Solved: qTranslate slug with Widget not working with pages" width="300" height="225" /></a><p class="wp-caption-text">Solved: qTranslate slug with Widget not working with pages</p></div>
<p>The problem was exactly at the function qTranslateSlug_filter_request inside de file qtranslate-slug-with-widget.php, which is the only one of the plugin, so it’s easy to find.<br />
We must take a look at this part of the code:</p>
<pre class="brush: php; title: ; notranslate">
if (isset($q['name'])) {
    $type = QTS_POST;
    $slug = $q['name'];
    $param = 'p';
    $get_link = 'get_permalink';
    unset($new_q['name']);
} else if (isset($q['pagename'])) {
    //$type = QTS_PAGE;
    //$slug = $q['pagename'];
    //$param = 'page_id';
    $id = qTranslateSlug_get_page_by_path($q['pagename'], $lang);
    if ($id) {
        unset($new_q['pagename']);
        $q = $new_q;
        $q['page_id'] = $id;
        $get_link = 'get_page_link';
    }
} else if (isset($q['category_name'])) {
    $type = QTS_CAT;
    $slug = $q['category_name'];
    $param = 'cat';
    $get_link = 'get_category_link';
    unset($new_q['category_name']);
} else if (isset($q['tag'])) {
    $type = QTS_TAG;
    $slug = $q['tag'];
    $param = 'tag_id';
    $get_link = 'get_tag_link';
    unset($new_q['tag']);
}
</pre>
<p>That we hace to replace with the following:</p>
<pre class="brush: php; title: ; notranslate">
if (isset($q['name'])) {
        $id = qTranslateSlug_get_page_by_path($q['name'], $lang);
        if ($id) {
            unset($new_q['name']);
            $q = $new_q;
            $q['page_id'] = $id;
            $get_link = 'get_page_link';
        } else {
            $type = QTS_POST;
            $slug = $q['name'];
            $param = 'p';
            $get_link = 'get_permalink';
            unset($new_q['name']);
        }
    } else if (isset($q['pagename'])) {
        $id = qTranslateSlug_get_page_by_path($q['pagename'], $lang);
        if ($id) {
            unset($new_q['pagename']);
            $q = $new_q;
            $q['page_id'] = $id;
            $get_link = 'get_page_link';
        }
    } else if (isset($q['category_name'])) {
        $type = QTS_CAT;
        $slug = $q['category_name'];
        $param = 'cat';
        $get_link = 'get_category_link';
        unset($new_q['category_name']);
    } else if (isset($q['tag'])) {
        $type = QTS_TAG;
        $slug = $q['tag'];
        $param = 'tag_id';
        $get_link = 'get_tag_link';
        unset($new_q['tag']);
    } else {
        $path = trim(preg_replace('/\?(.*)/', '', $_SERVER['REQUEST_URI']), '/');
        $id = qTranslateSlug_get_page_by_path($path, $lang);
        if ($id) {
            if (isset ($q['attachment'])) {
                unset($q['attachment']);
                unset($new_q['attachment']);
            }
            $q = $new_q;
            $q['page_id'] = $id;
            $get_link = 'get_page_link';
        }
    }
</pre>
<p>With the last wordpress versions, mine is 3.3.1, has changed the way of passing the query to the request filter, changing the array slug position from ‘pagename’ to ‘name’, then the plugin didn’t have a way to find any page, since it expected to find in the array the position ‘pagename’, nonexistent for the current case.<br />
Ref is taken from &#8211; http://en.codatavern.com/qtranslate-slug-with-widget-wordpress-plugin-fix/</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="get_permalink qutranslate">get_permalink qutranslate</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate tutorial">qtranslate tutorial</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate slugs not working">qtranslate slugs not working</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate slug with widget no url conversion">qtranslate slug with widget no url conversion</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate slug widget not working category">qtranslate slug widget not working category</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate slug post type">qtranslate slug post type</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate recent post widget">qtranslate recent post widget</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate pages menu">qtranslate pages menu</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate insert term with query sql">qtranslate insert term with query sql</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate extend widget titles not changing">qtranslate extend widget titles not changing</a></li><li><a href="http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/" title="qtranslate widget into menu how to">qtranslate widget into menu how to</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2012/01/09/solved-qtranslate-slug-with-widget-not-working-with-pages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Send email through wp_mail in html format with wordpress</title>
		<link>http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/</link>
		<comments>http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 09:59:54 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress api]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wordpress tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=6986</guid>
		<description><![CDATA[http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/In wordpress we use the wp_mail function for sending email. Following parameters we use for wp_mail Parameters Simple example: We can use this code for contact form or in functions.php file For html format email from wordpress. we just need &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/<p>In wordpress we use the wp_mail function for sending email. Following parameters we use for wp_mail</p>
<p><!--?php wp_mail( $to, $subject, $message, $headers, $attachments ); ?--><br />
Parameters</p>
<pre class="brush: php; title: ; notranslate">
$to
    (string or array) (required) The intended recipient(s). Multiple recipients may be specified using an array or a comma-separated string.

$subject
    (string) (required) The subject of the message.

$message
    (string) (required) Message content.

$headers
    (string or array) (optional) Mail headers to send with the message. (advanced)

$attachments
    (string or array) (optional) Files to attach: a single filename, an array of filenames, or a newline-delimited string list of multiple filenames. (advanced)
</pre>
<p>Simple example:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
   $attachments = array(WP_CONTENT_DIR . '/uploads/file_to_attach.zip');
   $headers = 'From: My Name &lt;myname@mydomain.com&gt;' . &quot;\r\n&quot;;
   wp_mail('test@test.com', 'subject', 'message', $headers, $attachments);
?&gt;
</pre>
<div id="attachment_6987" class="wp-caption alignnone<a href="http://wordpressapi.com/?attachment_id=6987" rel="attachment wp-att-6987"><img class="size-medium wp-image-6987" title="Send email through wp_mail in html format with wordpress" src="http://images.wordpressapi.com/wordpress-html-email-300x179.jpg" alt="Send email through wp_mail in html format with wordpress" width="300" height="179" /></a><p class="wp-caption-text">Send email through wp_mail in html format with wordpress</p></div>
<p>We can use this code for contact form or in functions.php file</p>
<p>For html format email from wordpress. we just need to add following line in functions.php file.</p>
<pre class="brush: php; title: ; notranslate">
add_filter('wp_mail_content_type',create_function('', 'return &quot;text/html&quot;;'));
</pre>
<p>Sending HTML email has risks. It could be caught in spam filters. The client may not support HTML formatting (although that&#8217;s rare). The client may disable email HTML from using javascript, CSS or grabbing remote assets like images.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="wp_mail tutorial">wp_mail tutorial</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="wp_mail examples">wp_mail examples</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="how to send html email wp_mail">how to send html email wp_mail</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="wp_mail send pdf file">wp_mail send pdf file</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="wp_mail link &lt;a href">wp_mail link &lt;a href</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="wp_mail html format">wp_mail html format</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="wp_mail header wordpress">wp_mail header wordpress</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="wp_mail example">wp_mail example</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="wordpress send mail format">wordpress send mail format</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="send mail with wp_mail">send mail with wp_mail</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="send form wordpress wp_mail without plugin">send form wordpress wp_mail without plugin</a></li><li><a href="http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/" title="wp_mail with html header">wp_mail with html header</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2012/01/06/send-email-through-wp_mail-in-html-format-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>how to integrate the wordpress with php or html</title>
		<link>http://wordpressapi.com/2011/12/06/how-to-integrate-the-wordpress-with-php-or-html/</link>
		<comments>http://wordpressapi.com/2011/12/06/how-to-integrate-the-wordpress-with-php-or-html/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 17:10:50 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress api]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wordpress tutorials]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=6974</guid>
		<description><![CDATA[http://wordpressapi.com/2011/12/06/how-to-integrate-the-wordpress-with-php-or-html/WordPress is very easy to work on. you can very easily integrate the wordpress with php or html site. There may be only a few features of WordPress you want to use when integrating it with your site, or you &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2011/12/06/how-to-integrate-the-wordpress-with-php-or-html/<p>WordPress is very easy to work on. you can very easily integrate the wordpress with php or html site. There may be only a few features of WordPress you want to use when integrating it with your site, or you may want your entire site run with WordPress. This tutorial will guide you through making your WordPress site look like your current design.</p>
<p>How to start?<br />
First you need to disable the wordpress theme. using following code.</p>
<p>open your header.php file from your wordpress theme and put following code in that file.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
?&gt;
</pre>
<p>Create any php file and put following code in that file.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
require('/the/path/to/your/wp-blog-header.php');
?&gt;
</pre>
<p>In the event you want to show ten posts sorted alphabetically in ascending order on your web page, you could do the following to grab the posted date, title and excerpt:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
require('/the/path/to/your/wp-blog-header.php');
?&gt;

&lt;?php
$posts = get_posts('numberposts=10&amp;order=ASC&amp;orderby=post_title');
foreach ($posts as $post) : start_wp(); ?&gt;
&lt;?php the_date(); echo &quot;&lt;br /&gt;&quot;; ?&gt;
&lt;?php the_title(); ?&gt;
&lt;?php the_excerpt(); ?&gt;
&lt;?php
endforeach;
?&gt;
</pre>
<div id="attachment_6975" class="wp-caption alignnone<a href="http://wordpressapi.com/2011/12/06/how-to-integrate-the-wordpress-with-php-or-html/convert-html-to-wordpress/" rel="attachment wp-att-6975"><img class="size-medium wp-image-6975" title="how to integrate the wordpress with php or html" src="http://images.wordpressapi.com/Convert-HTML-to-Wordpress-300x214.jpg" alt="how to integrate the wordpress with php or html" width="300" height="214" /></a><p class="wp-caption-text">how to integrate the wordpress with php or html</p></div>
<p>For more information you can write to me.</p>
<p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2011/12/06/how-to-integrate-the-wordpress-with-php-or-html/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to add the custom post type with associated tags and category</title>
		<link>http://wordpressapi.com/2011/11/28/how-to-add-the-custom-post-type-with-associated-tags-and-category/</link>
		<comments>http://wordpressapi.com/2011/11/28/how-to-add-the-custom-post-type-with-associated-tags-and-category/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 18:03:09 +0000</pubDate>
		<dc:creator>Wordpress API</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress api]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[custom post type]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://wordpressapi.com/?p=6948</guid>
		<description><![CDATA[http://wordpressapi.com/2011/11/28/how-to-add-the-custom-post-type-with-associated-tags-and-category/Many times we use the custom post type in wordpress. Some times we need to category and tags for custom post type which are only associated. you can use the following code in funcations.php file. Please consult with your developer. &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[http://wordpressapi.com/2011/11/28/how-to-add-the-custom-post-type-with-associated-tags-and-category/<p>Many times we use the custom post type in wordpress. Some times we need to category and tags for custom post type which are only associated.</p>
<p>you can use the following code in funcations.php file.</p>
<pre class="brush: php; title: ; notranslate">
// === CUSTOM POST TYPES === //
function create_my_post_types() {
	register_post_type( 'Services',
		array(
			'labels' =&gt; array(
				'name' =&gt; __( 'Services' ),
				'singular_name' =&gt; __( 'Services' ),
				'add_new_item' =&gt; 'Add New Services',
				'edit_item' =&gt; 'Edit Services',
				'new_item' =&gt; 'New Services',
				'search_items' =&gt; 'Search Services',
				'not_found' =&gt; 'No Services found',
				'not_found_in_trash' =&gt; 'No Services found in trash',
			),
			'_builtin' =&gt; false,
			'public' =&gt; true,
			'hierarchical' =&gt; false,
			'taxonomies' =&gt; array( 'website_type', 'service'),
			'supports' =&gt; array(
				'title',
				'editor',
				'excerpt',
                                'thumbnail'
			),
			'rewrite' =&gt; array( 'slug' =&gt; 'services', 'with_front' =&gt; false ),

		)
	);
}
add_action( 'init', 'create_my_post_types' );

// === CUSTOM TAXONOMIES === //
function my_custom_taxonomies() {
	register_taxonomy(
		'website_type',		// internal name = machine-readable taxonomy name
		'Services',		// object type = post, page, link, or custom post-type
		array(
			'hierarchical' =&gt; true,
			'label' =&gt; 'Website Types',	// the human-readable taxonomy name
			'query_var' =&gt; true,	// enable taxonomy-specific querying
			'rewrite' =&gt; array( 'slug' =&gt; 'website_type' ),	// pretty permalinks for your taxonomy?
		)
	);
	register_taxonomy(
		'service',
		'post',
		array(
			'hierarchical' =&gt; false,
			'label' =&gt; 'Service',
			'query_var' =&gt; true,
			'rewrite' =&gt; array( 'slug' =&gt; 'service' ),
		)
	);

}
add_action('init', 'my_custom_taxonomies', 0);
</pre>
<p>Please consult with your developer.</p>
<div id="attachment_6968" class="wp-caption alignnone<a href="http://wordpressapi.com/2011/11/28/how-to-add-the-custom-post-type-with-associated-tags-and-category/custom-post-type-wordpress1-2/" rel="attachment wp-att-6968"><img class="size-full wp-image-6968" title="How to add the custom post type with associated tags and category" src="http://images.wordpressapi.com/custom-post-type-wordpress11.gif" alt="How to add the custom post type with associated tags and category" width="300" height="250" /></a><p class="wp-caption-text">How to add the custom post type with associated tags and category</p></div>
<p>&nbsp;</p>
<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://wordpressapi.com/2011/11/28/how-to-add-the-custom-post-type-with-associated-tags-and-category/" title="wordpress custom post type tags">wordpress custom post type tags</a></li><li><a href="http://wordpressapi.com/2011/11/28/how-to-add-the-custom-post-type-with-associated-tags-and-category/" title="add category slug to custom post type">add category slug to custom post type</a></li><li><a href="http://wordpressapi.com/2011/11/28/how-to-add-the-custom-post-type-with-associated-tags-and-category/" title="how category is associated with post in wordpress">how category is associated with post in wordpress</a></li></ul><p>Follow us on Twitter <a href="http://twitter.com/wordpressapi">WordPress API</a></p>]]></content:encoded>
			<wfw:commentRss>http://wordpressapi.com/2011/11/28/how-to-add-the-custom-post-type-with-associated-tags-and-category/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: wordpressapi.com @ 2012-05-23 18:51:47 by W3 Total Cache -->
