<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Integrare metatags di Add Meta Tags e Ultimate Tag Warrior</title>
	<atom:link href="http://www.copesflavio.com/blog/blog/integrare-metatags-di-add-meta-tags-e-ultimate-tag-warrior/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.copesflavio.com/blog/blog/integrare-metatags-di-add-meta-tags-e-ultimate-tag-warrior/</link>
	<description>Joomla, Web Development, Joomla Templates</description>
	<pubDate>Thu, 28 Aug 2008 10:34:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Copes Flavio</title>
		<link>http://www.copesflavio.com/blog/blog/integrare-metatags-di-add-meta-tags-e-ultimate-tag-warrior/#comment-34</link>
		<dc:creator>Copes Flavio</dc:creator>
		<pubDate>Thu, 02 Aug 2007 18:38:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.copesflavio.com/blog/2007/07/05/integrare-metatags-di-add-meta-tags-e-ultimate-tag-warrior/#comment-34</guid>
		<description>&lt;p&gt;Per chiarezza ti riporto l'intera funzione amt_add_meta_tags() così come l'ho modificata. La risposta alla tua prima domanda è che ho commentato l'intero blocco, quindi tutta la direttiva if.&lt;/p&gt;
&lt;p&gt;In pratica non visualizzo i tags se sono nella pagina singola o in un post, mentre li visualizzo negli altri casi. &lt;/p&gt;
&lt;p&gt;function amt_add_meta_tags() {&lt;br /&gt;
	/*&lt;br /&gt;
	This is the main function that actually writes the meta tags to the&lt;br /&gt;
	appropriate page.&lt;br /&gt;
	*/&lt;br /&gt;
	global $posts, $include_keywords_in_single_posts;&lt;/p&gt;
&lt;p&gt;	// Get the options the DB&lt;br /&gt;
	$options = get_option("add_meta_tags_opts");&lt;br /&gt;
	$site_wide_meta = $options["site_wide_meta"];&lt;/p&gt;
&lt;p&gt;	$my_metatags = "";&lt;/p&gt;
&lt;p&gt;//	if ( is_single() &#124;&#124; is_page() ) {&lt;br /&gt;
		/*&lt;br /&gt;
		Add META tags to Single Page View or Page&lt;br /&gt;
		*/&lt;/p&gt;
&lt;p&gt;		// Custom Field names&lt;br /&gt;
//		$desc_fld = "description";&lt;br /&gt;
//		$keyw_fld = "keywords";&lt;/p&gt;
&lt;p&gt;		/*&lt;br /&gt;
		Description&lt;br /&gt;
		Custom post field "description" overrides post's excerpt in Single Post View.&lt;br /&gt;
		*/&lt;br /&gt;
//		$desc_fld_content = get_post_meta($posts[0]-&gt;ID, $desc_fld, true);&lt;br /&gt;
//		if ( !empty($desc_fld_content) ) {&lt;br /&gt;
			// If there is a custom field, use it&lt;br /&gt;
//			$my_metatags .= "\n&lt;meta name=\"description\" content=\"" . amt_clean_desc($desc_fld_content) . "\" /&gt;";&lt;br /&gt;
//		} elseif ( is_single() ) {&lt;br /&gt;
			// Else, use the post's excerpt. Only for Single Post View (not valid for Pages)&lt;br /&gt;
//			$my_metatags .= "\n&lt;meta name=\"description\" content=\"" . amt_clean_desc(amt_get_the_excerpt()) . "\" /&gt;";&lt;br /&gt;
//		}&lt;/p&gt;
&lt;p&gt;		/*&lt;br /&gt;
		Keywords&lt;br /&gt;
		Custom post field "keywords" overrides post's categories.&lt;br /&gt;
		%cats% is replaced by the post's categories.&lt;br /&gt;
		NOTE: if $include_keywords_in_single_posts is FALSE, then keywords&lt;br /&gt;
		metatag is not added to single posts.&lt;br /&gt;
		*/&lt;br /&gt;
//		if ( ($include_keywords_in_single_posts &#038;&#038; is_single()) &#124;&#124; is_page() ) {&lt;br /&gt;
//			$keyw_fld_content = get_post_meta($posts[0]-&gt;ID, $keyw_fld, true);&lt;br /&gt;
//			if ( !empty($keyw_fld_content) ) {&lt;br /&gt;
				// If there is a custom field, use it&lt;br /&gt;
//				if ( is_single() ) {&lt;br /&gt;
					// For single posts, the %cat% tag is replaced by the post's categories&lt;br /&gt;
//					$keyw_fld_content = str_replace("%cats%", amt_get_keywords_from_post_cats(), $keyw_fld_content);&lt;br /&gt;
//				}&lt;br /&gt;
//				$my_metatags .= "\n&lt;meta name=\"keywords\" content=\"" . strtolower($keyw_fld_content) . "\" /&gt;";&lt;br /&gt;
//			} elseif ( is_single() ) {&lt;br /&gt;
				// Else use only the post's categories. Only for Single Post View (not valid for Pages)&lt;br /&gt;
//				$my_metatags .= "\n&lt;meta name=\"keywords\" content=\"" . strtolower(amt_get_keywords_from_post_cats()) . "\" /&gt;";&lt;br /&gt;
//			}&lt;br /&gt;
//		}&lt;/p&gt;
&lt;p&gt;//	} elseif ( is_home() ) {&lt;br /&gt;
	if ( is_home() ) {&lt;br /&gt;
		/*&lt;br /&gt;
		Add META tags to Home Page&lt;br /&gt;
		*/&lt;/p&gt;
&lt;p&gt;		// Description and Keywords from the options override default behaviour&lt;br /&gt;
		$site_description = $options["site_description"];&lt;br /&gt;
		$site_keywords = $options["site_keywords"];&lt;/p&gt;
&lt;p&gt;		// Description&lt;br /&gt;
		if ( empty($site_description) ) {&lt;br /&gt;
			// If $site_description is empty, then use the blog description from the options&lt;br /&gt;
			$my_metatags .= "\n&lt;meta name=\"description\" content=\"" . amt_clean_desc(get_bloginfo('description')) . "\" /&gt;";&lt;br /&gt;
		} else {&lt;br /&gt;
			// If $site_description has been set, then use it in the description meta-tag&lt;br /&gt;
			$my_metatags .= "\n&lt;meta name=\"description\" content=\"" . amt_clean_desc($site_description) . "\" /&gt;";&lt;br /&gt;
		}&lt;br /&gt;
		// Keywords&lt;br /&gt;
		if ( empty($site_keywords) ) {&lt;br /&gt;
			// If $site_keywords is empty, then all the blog's categories are added as keywords&lt;br /&gt;
			$my_metatags .= "\n&lt;meta name=\"keywords\" content=\"" . amt_get_all_categories() . "\" /&gt;";&lt;br /&gt;
		} else {&lt;br /&gt;
			// If $site_keywords has been set, then these keywords are used.&lt;br /&gt;
			$my_metatags .= "\n&lt;meta name=\"keywords\" content=\"" . $site_keywords . "\" /&gt;";&lt;br /&gt;
		}&lt;/p&gt;
&lt;p&gt;	} elseif ( is_category() ) {&lt;br /&gt;
		/*&lt;br /&gt;
		Writes a description META tag only if a description for the current category has been set.&lt;br /&gt;
		*/&lt;/p&gt;
&lt;p&gt;		$cur_cat_desc = category_description();&lt;br /&gt;
		if ( $cur_cat_desc ) {&lt;br /&gt;
			$my_metatags .= "\n&lt;meta name=\"description\" content=\"" . amt_clean_desc($cur_cat_desc) . "\" /&gt;";&lt;br /&gt;
		}&lt;br /&gt;
		// Write a keyword metatag if there is a category name (always)&lt;br /&gt;
		$cur_cat_name = single_cat_title($prefix = '', $display = false );&lt;br /&gt;
		if ( $cur_cat_name ) {&lt;br /&gt;
			$my_metatags .= "\n&lt;meta name=\"keywords\" content=\"" . strtolower($cur_cat_name) . "\" /&gt;";&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;/p&gt;
&lt;p&gt;	if ($my_metatags) {&lt;br /&gt;
		echo "\n&#60;!-- META Tags added by Add-Meta-Tags WordPress plugin. Get it at: http://www.g-loaded.eu/ --&#62;" . $my_metatags . "\n" . amt_get_site_wide_metatags($site_wide_meta) . "\n\n";&lt;br /&gt;
	}&lt;br /&gt;
}&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Per chiarezza ti riporto l&#8217;intera funzione amt_add_meta_tags() così come l&#8217;ho modificata. La risposta alla tua prima domanda è che ho commentato l&#8217;intero blocco, quindi tutta la direttiva if.</p>
<p>In pratica non visualizzo i tags se sono nella pagina singola o in un post, mentre li visualizzo negli altri casi. </p>
<p>function amt_add_meta_tags() {<br />
	/*<br />
	This is the main function that actually writes the meta tags to the<br />
	appropriate page.<br />
	*/<br />
	global $posts, $include_keywords_in_single_posts;</p>
<p>	// Get the options the DB<br />
	$options = get_option(&#8221;add_meta_tags_opts&#8221;);<br />
	$site_wide_meta = $options["site_wide_meta"];</p>
<p>	$my_metatags = &#8220;&#8221;;</p>
<p>//	if ( is_single() || is_page() ) {<br />
		/*<br />
		Add META tags to Single Page View or Page<br />
		*/</p>
<p>		// Custom Field names<br />
//		$desc_fld = &#8220;description&#8221;;<br />
//		$keyw_fld = &#8220;keywords&#8221;;</p>
<p>		/*<br />
		Description<br />
		Custom post field &#8220;description&#8221; overrides post&#8217;s excerpt in Single Post View.<br />
		*/<br />
//		$desc_fld_content = get_post_meta($posts[0]->ID, $desc_fld, true);<br />
//		if ( !empty($desc_fld_content) ) {<br />
			// If there is a custom field, use it<br />
//			$my_metatags .= &#8220;\n<meta name=\"description\" content=\"" . amt_clean_desc($desc_fld_content) . "\" />&#8220;;<br />
//		} elseif ( is_single() ) {<br />
			// Else, use the post&#8217;s excerpt. Only for Single Post View (not valid for Pages)<br />
//			$my_metatags .= &#8220;\n<meta name=\"description\" content=\"" . amt_clean_desc(amt_get_the_excerpt()) . "\" />&#8220;;<br />
//		}</p>
<p>		/*<br />
		Keywords<br />
		Custom post field &#8220;keywords&#8221; overrides post&#8217;s categories.<br />
		%cats% is replaced by the post&#8217;s categories.<br />
		NOTE: if $include_keywords_in_single_posts is FALSE, then keywords<br />
		metatag is not added to single posts.<br />
		*/<br />
//		if ( ($include_keywords_in_single_posts &#038;&#038; is_single()) || is_page() ) {<br />
//			$keyw_fld_content = get_post_meta($posts[0]->ID, $keyw_fld, true);<br />
//			if ( !empty($keyw_fld_content) ) {<br />
				// If there is a custom field, use it<br />
//				if ( is_single() ) {<br />
					// For single posts, the %cat% tag is replaced by the post&#8217;s categories<br />
//					$keyw_fld_content = str_replace(&#8221;%cats%&#8221;, amt_get_keywords_from_post_cats(), $keyw_fld_content);<br />
//				}<br />
//				$my_metatags .= &#8220;\n<meta name=\"keywords\" content=\"" . strtolower($keyw_fld_content) . "\" />&#8220;;<br />
//			} elseif ( is_single() ) {<br />
				// Else use only the post&#8217;s categories. Only for Single Post View (not valid for Pages)<br />
//				$my_metatags .= &#8220;\n<meta name=\"keywords\" content=\"" . strtolower(amt_get_keywords_from_post_cats()) . "\" />&#8220;;<br />
//			}<br />
//		}</p>
<p>//	} elseif ( is_home() ) {<br />
	if ( is_home() ) {<br />
		/*<br />
		Add META tags to Home Page<br />
		*/</p>
<p>		// Description and Keywords from the options override default behaviour<br />
		$site_description = $options["site_description"];<br />
		$site_keywords = $options["site_keywords"];</p>
<p>		// Description<br />
		if ( empty($site_description) ) {<br />
			// If $site_description is empty, then use the blog description from the options<br />
			$my_metatags .= &#8220;\n<meta name=\"description\" content=\"" . amt_clean_desc(get_bloginfo('description')) . "\" />&#8220;;<br />
		} else {<br />
			// If $site_description has been set, then use it in the description meta-tag<br />
			$my_metatags .= &#8220;\n<meta name=\"description\" content=\"" . amt_clean_desc($site_description) . "\" />&#8220;;<br />
		}<br />
		// Keywords<br />
		if ( empty($site_keywords) ) {<br />
			// If $site_keywords is empty, then all the blog&#8217;s categories are added as keywords<br />
			$my_metatags .= &#8220;\n<meta name=\"keywords\" content=\"" . amt_get_all_categories() . "\" />&#8220;;<br />
		} else {<br />
			// If $site_keywords has been set, then these keywords are used.<br />
			$my_metatags .= &#8220;\n<meta name=\"keywords\" content=\"" . $site_keywords . "\" />&#8220;;<br />
		}</p>
<p>	} elseif ( is_category() ) {<br />
		/*<br />
		Writes a description META tag only if a description for the current category has been set.<br />
		*/</p>
<p>		$cur_cat_desc = category_description();<br />
		if ( $cur_cat_desc ) {<br />
			$my_metatags .= &#8220;\n<meta name=\"description\" content=\"" . amt_clean_desc($cur_cat_desc) . "\" />&#8220;;<br />
		}<br />
		// Write a keyword metatag if there is a category name (always)<br />
		$cur_cat_name = single_cat_title($prefix = &#8221;, $display = false );<br />
		if ( $cur_cat_name ) {<br />
			$my_metatags .= &#8220;\n<meta name=\"keywords\" content=\"" . strtolower($cur_cat_name) . "\" />&#8220;;<br />
		}<br />
	}</p>
<p>	if ($my_metatags) {<br />
		echo &#8220;\n&lt;!&#8211; META Tags added by Add-Meta-Tags WordPress plugin. Get it at: <a href="http://www.g-loaded.eu/" rel="nofollow">http://www.g-loaded.eu/</a> &#8211;&gt;&#8221; . $my_metatags . &#8220;\n&#8221; . amt_get_site_wide_metatags($site_wide_meta) . &#8220;\n\n&#8221;;<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alessio</title>
		<link>http://www.copesflavio.com/blog/blog/integrare-metatags-di-add-meta-tags-e-ultimate-tag-warrior/#comment-33</link>
		<dc:creator>Alessio</dc:creator>
		<pubDate>Mon, 30 Jul 2007 14:07:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.copesflavio.com/blog/2007/07/05/integrare-metatags-di-add-meta-tags-e-ultimate-tag-warrior/#comment-33</guid>
		<description>Anche io vorrei attuare la tua modifica.
Ho installato la Version: 1.2 di Add Meta tags.Devo chiederti due cose.
1) Cosa intendi per 'ho commentato il blocco
if ( is_single() &#124;&#124; is_page() ) {'  ?

2) La parte da sostiruire 
} elseif ( is_home() ) {
è' quella della riga 444 ?</description>
		<content:encoded><![CDATA[<p>Anche io vorrei attuare la tua modifica.<br />
Ho installato la Version: 1.2 di Add Meta tags.Devo chiederti due cose.<br />
1) Cosa intendi per &#8216;ho commentato il blocco<br />
if ( is_single() || is_page() ) {&#8217;  ?</p>
<p>2) La parte da sostiruire<br />
} elseif ( is_home() ) {<br />
è&#8217; quella della riga 444 ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
