<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<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>Support Forum - Topic: Activate related posts</title>
		<link>http://www.kriesi.at/support/topic/activate-related-posts</link>
		<description>Support Forum - Topic: Activate related posts</description>
		<language>en-US</language>
		<pubDate>Sat, 25 May 2013 12:18:48 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.kriesi.at/support/search.php</link>
		</textInput>
		<atom:link href="http://www.kriesi.at/support/rss/topic/activate-related-posts" rel="self" type="application/rss+xml" />

		<item>
			<title>Mya on "Activate related posts"</title>
			<link>http://www.kriesi.at/support/topic/activate-related-posts#post-54058</link>
			<pubDate>Tue, 01 May 2012 00:38:39 +0000</pubDate>
			<dc:creator>Mya</dc:creator>
			<guid isPermaLink="false">54058@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi Poirot,&#60;/p&#62;
&#60;p&#62;Glad you figured it out! Let us know if you have more questions.&#60;/p&#62;
&#60;p&#62;Regards,&#60;br /&#62;
Mya
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Poirot on "Activate related posts"</title>
			<link>http://www.kriesi.at/support/topic/activate-related-posts#post-53712</link>
			<pubDate>Fri, 27 Apr 2012 15:25:17 +0000</pubDate>
			<dc:creator>Poirot</dc:creator>
			<guid isPermaLink="false">53712@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi, &#60;/p&#62;
&#60;p&#62;Solved. I deleted all tags, then created them again. That's it :-)&#60;/p&#62;
&#60;p&#62;Thanks anyway, great theme.&#60;/p&#62;
&#60;p&#62;Regards,
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Poirot on "Activate related posts"</title>
			<link>http://www.kriesi.at/support/topic/activate-related-posts#post-53512</link>
			<pubDate>Thu, 26 Apr 2012 14:53:49 +0000</pubDate>
			<dc:creator>Poirot</dc:creator>
			<guid isPermaLink="false">53512@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi Ismael,&#60;/p&#62;
&#60;p&#62;Thanks for helping out. &#60;/p&#62;
&#60;p&#62;No I didn't change anything. I updated part of the code (as indicated here on the forum) to activate related posts based on categories (instead of tags). But then switched it back to the original code.&#60;/p&#62;
&#60;p&#62;Some questions:&#60;/p&#62;
&#60;p&#62;1) Is the second line of the code correct? (value is false?)&#60;/p&#62;
&#60;p&#62;$reladed_posts = false;&#60;/p&#62;
&#60;p&#62;2) Is it necessary to upload extra thumbnails for the related posts, or should it automatically scale the featured image? &#60;/p&#62;
&#60;p&#62;Regards, Poirot
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Ismael on "Activate related posts"</title>
			<link>http://www.kriesi.at/support/topic/activate-related-posts#post-53445</link>
			<pubDate>Thu, 26 Apr 2012 07:43:01 +0000</pubDate>
			<dc:creator>Ismael</dc:creator>
			<guid isPermaLink="false">53445@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;It should work by default. Did you edit anything on the file?&#60;/p&#62;
&#60;p&#62;Please reload the related-post.php and try again. :)&#60;/p&#62;
&#60;p&#62;Regards,&#60;/p&#62;
&#60;p&#62;Ismael
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Poirot on "Activate related posts"</title>
			<link>http://www.kriesi.at/support/topic/activate-related-posts#post-53298</link>
			<pubDate>Wed, 25 Apr 2012 16:20:01 +0000</pubDate>
			<dc:creator>Poirot</dc:creator>
			<guid isPermaLink="false">53298@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Corona is a fantastic theme, thumbs up!&#60;/p&#62;
&#60;p&#62;I have assigned categories and tags to my posts, however no related posts are visible. &#60;/p&#62;
&#60;p&#62;Can you please help me out? See the related-post.php code below. Thank you in advance!&#60;/p&#62;
&#60;p&#62;$columns = 3;&#60;br /&#62;
$reladed_posts = false;&#60;br /&#62;
$this_id = $post-&#38;gt;ID;&#60;br /&#62;
$slidecount = 0;&#60;br /&#62;
$postcount = ($columns * 3) + 1;&#60;/p&#62;
&#60;p&#62;$tags = wp_get_post_tags($post-&#38;gt;ID);&#60;br /&#62;
if ($tags) {&#60;/p&#62;
&#60;p&#62;     $tag_ids = &#34;&#34;;&#60;br /&#62;
     foreach ($tags as $tag ) $tag_ids .= $tag-&#38;gt;name.&#34;,&#34;;&#60;br /&#62;
     $tag_ids = substr_replace($tag_ids ,&#34;&#34;,-1);&#60;br /&#62;
     $tag_ids = str_replace(&#34; &#34;, &#34;-&#34;,$tag_ids);&#60;/p&#62;
&#60;p&#62;     if($tag_ids)&#60;br /&#62;
     {&#60;br /&#62;
     	$my_query = new WP_Query(&#34;tag=$tag_ids&#38;amp;showposts=$postcount&#38;amp;ignore_sticky_posts=1&#38;amp;orderby=rand&#34;);&#60;/p&#62;
&#60;p&#62;  		if ($my_query-&#38;gt;have_posts())&#60;br /&#62;
  		{&#60;br /&#62;
  			$count = 1;&#60;br /&#62;
  			$output = &#34;&#34;;&#60;/p&#62;
&#60;p&#62;  			$output .= &#34;&#38;lt;div class='hr hr_related_posts'&#38;gt;&#38;lt;/div&#38;gt;&#34;;&#60;br /&#62;
  			$output .= &#34;&#38;lt;div class='related-meta'&#38;gt;&#34;;&#60;br /&#62;
  			$output .= &#34;&#38;lt;h3 class='miniheading'&#38;gt;&#34;.__('Related Posts','avia_framework').&#34;&#38;lt;/h3&#38;gt;&#34;;&#60;br /&#62;
	 		$output .= &#34;&#38;lt;span class='minitext'&#38;gt;&#34;.__('Did you like this entry? &#60;br /&#62;Here are a few more posts that might be interesting for you.','avia_framework').&#34;&#38;lt;/span&#38;gt;&#34;;&#60;br /&#62;
  			$output .= &#34;&#38;lt;/div&#38;gt;&#34;;&#60;/p&#62;
&#60;p&#62;     		$output .= &#34;&#38;lt;div class ='related_posts'&#38;gt;&#34;;&#60;br /&#62;
     		$output .= &#34;&#38;lt;strong class='related_single_heading'&#38;gt;Related Posts&#34;;&#60;br /&#62;
     		$output .= &#34;&#38;lt;div class='content_slider autoslide_false'&#38;gt;&#34;;&#60;/p&#62;
&#60;p&#62;     		while ($my_query-&#38;gt;have_posts()) : $my_query-&#38;gt;the_post();&#60;br /&#62;
     		if($post-&#38;gt;ID != $this_id)&#60;br /&#62;
     		{&#60;br /&#62;
     			$reladed_posts = true;&#60;br /&#62;
     			$slidecount ++;&#60;/p&#62;
&#60;p&#62;     			if($count == 1)&#60;br /&#62;
     			{&#60;br /&#62;
     				$output .= &#34;&#38;lt;div class='single_slide single_slide_nr_$slidecount'&#38;gt;&#34;;&#60;br /&#62;
     			}&#60;/p&#62;
&#60;p&#62;     			$image = &#34;&#38;lt;span class='related_posts_default_image'&#38;gt;&#38;lt;/span&#38;gt;&#34;;&#60;br /&#62;
	 			$slides = avia_post_meta(get_the_ID(), 'slideshow', true);&#60;/p&#62;
&#60;p&#62;	 			//check if a preview image is set&#60;br /&#62;
	 			if( $slides != &#34;&#34; &#38;amp;&#38;amp; !empty( $slides[0]['slideshow_image']) )&#60;br /&#62;
	 			{&#60;br /&#62;
	 				//check for image or video&#60;br /&#62;
	 				if(is_numeric($slides[0]['slideshow_image']))&#60;br /&#62;
	 				{&#60;br /&#62;
	 					$image = avia_image_by_id($slides[0]['slideshow_image'], 'related', 'image');&#60;br /&#62;
	 				}&#60;br /&#62;
	 				else&#60;br /&#62;
	 				{&#60;br /&#62;
	 					$image = &#34;&#38;lt;span class='related_posts_default_image related_posts_video'&#38;gt;&#38;lt;/span&#38;gt;&#34;;&#60;br /&#62;
	 				}&#60;/p&#62;
&#60;p&#62;	 			}&#60;/p&#62;
&#60;p&#62;     			$output .= &#34;&#38;lt;div class='relThumb relThumb&#34;.$count.&#34;'&#38;gt;\n&#34;;&#60;br /&#62;
	 			$output .= &#34;&#60;a href='&#34;.get_permalink().&#34;'&#62;\n&#34;;&#60;br /&#62;
     			$output .= &#34;&#38;lt;span class='related_image_wrap'&#38;gt;&#34;;&#60;br /&#62;
	 			$output .= &#34;&#38;lt;span class='rounded_corner rctl'&#38;gt;&#38;lt;/span&#38;gt;&#34;;&#60;br /&#62;
				$output .= &#34;&#38;lt;span class='rounded_corner rctr'&#38;gt;&#38;lt;/span&#38;gt;&#34;;&#60;br /&#62;
				$output .= &#34;&#38;lt;span class='rounded_corner rcbl'&#38;gt;&#38;lt;/span&#38;gt;&#34;;&#60;br /&#62;
				$output .= &#34;&#38;lt;span class='rounded_corner rcbr'&#38;gt;&#38;lt;/span&#38;gt;&#34;;&#60;br /&#62;
	 			$output .= $image;&#60;br /&#62;
	 			$output .= &#34;&#38;lt;/span&#38;gt;\n&#34;;&#60;br /&#62;
	 			$output .= &#34;&#38;lt;span class='relThumbTitle'&#38;gt;\n&#34;;&#60;br /&#62;
	 			$output .= &#34;&#38;lt;strong class='relThumbHeading'&#38;gt;&#34;.avia_backend_truncate(get_the_title(), 50).&#34;\n&#34;;&#60;br /&#62;
	 			$output .= &#34;&#38;lt;/span&#38;gt;\n&#60;/a&#62;&#34;;&#60;br /&#62;
	 			$output .= &#34;&#38;lt;/div&#38;gt;&#38;lt;!-- end .relThumb --&#38;gt;\n&#34;;&#60;/p&#62;
&#60;p&#62;     			$count++;&#60;/p&#62;
&#60;p&#62;     			if($count == $columns+1)&#60;br /&#62;
     			{&#60;br /&#62;
     				$output .= &#34;&#38;lt;/div&#38;gt;&#34;;&#60;br /&#62;
     				$count = 1;&#60;br /&#62;
     			}&#60;br /&#62;
     		}&#60;br /&#62;
     		endwhile; &#60;/p&#62;
&#60;p&#62; 	 		if($count != 1) $output .= &#34;&#38;lt;/div&#38;gt;&#34;;&#60;/p&#62;
&#60;p&#62;     		$output .= &#34;&#38;lt;/div&#38;gt;&#38;lt;/div&#38;gt;&#34;;&#60;br /&#62;
     		if($reladed_posts) echo $output;&#60;/p&#62;
&#60;p&#62;     	}&#60;/p&#62;
&#60;p&#62;     	wp_reset_query();&#60;br /&#62;
    }&#60;br /&#62;
}
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
