<?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: Portfolio random sorting</title>
		<link>http://www.kriesi.at/support/topic/portfolio-random-sorting</link>
		<description>Support Forum - Topic: Portfolio random sorting</description>
		<language>en-US</language>
		<pubDate>Wed, 19 Jun 2013 04:42:59 +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/portfolio-random-sorting" rel="self" type="application/rss+xml" />

		<item>
			<title>Dude on "Portfolio random sorting"</title>
			<link>http://www.kriesi.at/support/topic/portfolio-random-sorting#post-82456</link>
			<pubDate>Tue, 06 Nov 2012 05:21:53 +0000</pubDate>
			<dc:creator>Dude</dc:creator>
			<guid isPermaLink="false">82456@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi! &#60;/p&#62;
&#60;p&#62; I tagged this thread for Kriesi. &#60;/p&#62;
&#60;p&#62; Regards,&#60;br /&#62;
Peter
&#60;/p&#62;</description>
		</item>
		<item>
			<title>keidgen on "Portfolio random sorting"</title>
			<link>http://www.kriesi.at/support/topic/portfolio-random-sorting#post-82354</link>
			<pubDate>Mon, 05 Nov 2012 18:05:06 +0000</pubDate>
			<dc:creator>keidgen</dc:creator>
			<guid isPermaLink="false">82354@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;As experiment I tried this:&#60;/p&#62;
&#60;p&#62;&#60;pre&#62;&#60;code&#62;&#60;br /&#62;
function loop_portfolio_query( $location )&#60;br /&#62;
{&#60;br /&#62;
   if ( $location == 'loop-portfolio' )&#60;br /&#62;
    {&#60;br /&#62;
        global $avia_config;&#60;br /&#62;
         if(isset($avia_config['new_query'])) {&#60;br /&#62;
			$avia_config['new_query']['orderby'] = &#34;rand&#34;;&#60;br /&#62;
            query_posts($avia_config['new_query']);&#60;br /&#62;
         }&#60;br /&#62;
   }&#60;br /&#62;
}&#60;br /&#62;
add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );&#60;/code&#62;&#60;/pre&#62;&#60;/p&#62;
&#60;p&#62;and as expected it sorts all portfolio items randomly on all pages. So I suspect that what I wrote above is true. If only it is possible at least to sort all items when set as 12 per page, as I mentioned before, I think it might be suitable for me in this case.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>keidgen on "Portfolio random sorting"</title>
			<link>http://www.kriesi.at/support/topic/portfolio-random-sorting#post-82343</link>
			<pubDate>Mon, 05 Nov 2012 17:36:22 +0000</pubDate>
			<dc:creator>keidgen</dc:creator>
			<guid isPermaLink="false">82343@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi Dude,&#60;br /&#62;
thanks for your response!&#60;/p&#62;
&#60;p&#62;I pasted the code you suggested, but it does nothing at all yet again. Portfolio on Frontpage still sorts the latest items instead of random.&#60;br /&#62;
Just for lulz I tried the code from &#34;Portfolio Sort Order - reverse chronological&#34; post to see if it will sort items in reversed order at least, and it works for all the pages, including the Main page, of course.&#60;/p&#62;
&#60;p&#62;So my suggestion is that it does not recognize that the page is Frontpage so it ignores the code completely.&#60;br /&#62;
Just an idea, but maybe it is easier to try to set some sort of a condition - if number of portfolio items is 12 then sort randomly for portfolio items in general portfolio settings? And as I have 12 items set only for main page it will sort it there randomly? It sounds like an ugly solution, but for me it does not matter anymore. I just need it to work one way or another  :)&#60;/p&#62;
&#60;p&#62;Or maybe the issue is that the general portfolio settings that allow items to be sorted in chronological/reverse order still override the random settings for Frontpage? Either way it just ignores this part of code like it never existed.&#60;/p&#62;
&#60;p&#62;I think that adding random sorting option to portfolio features in later releases of the theme would be a great idea. Am I really the only one needs or will need a feature like this?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Dude on "Portfolio random sorting"</title>
			<link>http://www.kriesi.at/support/topic/portfolio-random-sorting#post-82333</link>
			<pubDate>Mon, 05 Nov 2012 16:57:29 +0000</pubDate>
			<dc:creator>Dude</dc:creator>
			<guid isPermaLink="false">82333@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Tbh I'm not sure why it doesn't work but you can try following code instead:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function loop_portfolio_query( $location )
{
   global $avia_config;
   if ( $location == &#38;#39;loop-portfolio&#38;#39; &#38;amp;&#38;amp; !empty($avia_config[&#38;#39;frontpage&#38;#39;])  )
    {
         if(isset($avia_config[&#38;#39;new_query&#38;#39;])) {
            $avia_config[&#38;#39;new_query&#38;#39;][&#38;#39;orderby&#38;#39;] = &#38;quot;rand&#38;quot;;
            $avia_config[&#38;#39;new_query&#38;#39;][&#38;#39;posts_per_page&#38;#39;] = &#38;quot;12&#38;quot;;
            query_posts($avia_config[&#38;#39;new_query&#38;#39;]);
         }
   }
}
add_action( &#38;#39;avia_action_query_check&#38;#39; , &#38;#39;loop_portfolio_query&#38;#39;, 10, 1 );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then open up header.php and replace following code at the very top:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;global $avia_config;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;with:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;global $avia_config;
$avia_config[&#38;#39;frontpage&#38;#39;] = ( is_home() &#124;&#124; is_front_page() ) ? &#38;#39;frontpage&#38;#39; : &#38;#39;&#38;#39;;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>keidgen on "Portfolio random sorting"</title>
			<link>http://www.kriesi.at/support/topic/portfolio-random-sorting#post-82305</link>
			<pubDate>Mon, 05 Nov 2012 15:09:53 +0000</pubDate>
			<dc:creator>keidgen</dc:creator>
			<guid isPermaLink="false">82305@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hey guys,&#60;/p&#62;
&#60;p&#62;so can I count on a reply about my case? Its been quite a while since I posted it.&#60;br /&#62;
I know that might not be the simplest question, but still I doubt its something impossible to do...&#60;/p&#62;
&#60;p&#62;Or should I start looking for another theme that has this option?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Devin on "Portfolio random sorting"</title>
			<link>http://www.kriesi.at/support/topic/portfolio-random-sorting#post-81998</link>
			<pubDate>Fri, 02 Nov 2012 16:34:56 +0000</pubDate>
			<dc:creator>Devin</dc:creator>
			<guid isPermaLink="false">81998@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hey keidgen,&#60;/p&#62;
&#60;p&#62;I've tagged Dude on this post so he should see it in his queue asap.&#60;/p&#62;
&#60;p&#62;Regards,&#60;/p&#62;
&#60;p&#62;Devin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>keidgen on "Portfolio random sorting"</title>
			<link>http://www.kriesi.at/support/topic/portfolio-random-sorting#post-81796</link>
			<pubDate>Thu, 01 Nov 2012 12:50:29 +0000</pubDate>
			<dc:creator>keidgen</dc:creator>
			<guid isPermaLink="false">81796@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi Dude,&#60;/p&#62;
&#60;p&#62;thanks for your response! I pasted the code into functions.php but unfortunately it does nothing at all.&#60;br /&#62;
Hope you can help me more with it. It is really crucial.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Dude on "Portfolio random sorting"</title>
			<link>http://www.kriesi.at/support/topic/portfolio-random-sorting#post-81675</link>
			<pubDate>Wed, 31 Oct 2012 12:40:37 +0000</pubDate>
			<dc:creator>Dude</dc:creator>
			<guid isPermaLink="false">81675@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
try to add following code to the bottom of functions.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function loop_portfolio_query( $location )
{
   if ( $location == &#38;#39;loop-portfolio&#38;#39; &#38;amp;&#38;amp; (is_home() &#124;&#124; is_front_page()) )
    {
        global $avia_config;
         if(isset($avia_config[&#38;#39;new_query&#38;#39;])) {
            $avia_config[&#38;#39;new_query&#38;#39;][&#38;#39;orderby&#38;#39;] = &#38;quot;rand&#38;quot;;
            $avia_config[&#38;#39;new_query&#38;#39;][&#38;#39;posts_per_page&#38;#39;] = &#38;quot;12&#38;quot;;
            query_posts($avia_config[&#38;#39;new_query&#38;#39;]);
         }
   }
}
add_action( &#38;#39;avia_action_query_check&#38;#39; , &#38;#39;loop_portfolio_query&#38;#39;, 10, 1 );&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>keidgen on "Portfolio random sorting"</title>
			<link>http://www.kriesi.at/support/topic/portfolio-random-sorting#post-81538</link>
			<pubDate>Tue, 30 Oct 2012 11:56:28 +0000</pubDate>
			<dc:creator>keidgen</dc:creator>
			<guid isPermaLink="false">81538@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hey guys,&#60;/p&#62;
&#60;p&#62;The theme is awesome, but there is something I want to add to portfolio functionality.&#60;/p&#62;
&#60;p&#62;I need portfolio items on my main page be showcased randomly.&#60;br /&#62;
Say, I have 12 portfolio items displayed out if 30, and I need them to change randomly each time someone visits/reloads that page.&#60;/p&#62;
&#60;p&#62;So how can I do this?&#60;/p&#62;
&#60;p&#62;Thanks in advance,&#60;br /&#62;
Darina
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
