<?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>gasolicious.com &#187;   &#8211; Website of Mark Gason &#8211; Gasolicious &#8211; design and E-commerce</title>
	<atom:link href="http://gasolicious.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gasolicious.com</link>
	<description></description>
	<lastBuildDate>Sun, 21 Apr 2013 20:44:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Temporarily close your WP e-Commerce store</title>
		<link>http://gasolicious.com/temporarily-close-your-wp-e-commerce-store/</link>
		<comments>http://gasolicious.com/temporarily-close-your-wp-e-commerce-store/#comments</comments>
		<pubDate>Fri, 19 Apr 2013 01:43:00 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[E-Commerce]]></category>
		<category><![CDATA[Storefront Themes]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=2141</guid>
		<description><![CDATA[The question Everyone needs a break and not all of you are giant companies. Some of you are small one or two person operations making gorgeous things with love. I received this question about the online store of one such artisan manufacturer, &#8216;Coco Suisse&#8221; whose chocolates are awesome by the way&#8230;. &#8220;I&#8217;m actually taking off [...]]]></description>
				<content:encoded><![CDATA[<h4>The question</h4>
<p>Everyone needs a break and not all of you are giant companies. Some of you are small one or two person operations making gorgeous things with love. I received this question about the online store of one such artisan manufacturer,  &#8216;<a href="http://cocosuisse.com/" title="coco suisse awesome artisan chocolate manufacturer" target="_blank">Coco Suisse</a>&#8221; whose chocolates are awesome by the way&#8230;.<br />
&#8220;I&#8217;m actually taking off on vacation in a couple of weeks and was wondering if there was an easy way to keep my website up but temporarily prevent people from being able to order?&#8221;</p>
<h4>Answer</h4>
<p>I think you need to achieve two things.</p>
<ol>
<li>inform people that you are not accepting orders</li>
<li>make sure anyone who is not very observant can not actually place an order</li>
</ol>
<p>You can add a message to every page quite easily with CSS. You can add content to a page using CSS with the <a href="http://www.w3schools.com/cssref/sel_before.asp" title="w3schools explanation of :before" target="_blank">before</a> and <a href="http://www.w3schools.com/cssref/sel_after.asp" title="w3schools explanation of after selector" target="_blank">after</a> selectors and the content property. You add the <a href="http://www.w3schools.com/cssref/sel_before.asp" title="w3schools explanation of :before" target="_blank">before</a> or <a href="http://www.w3schools.com/cssref/sel_after.asp" title="w3schools explanation of after selector" target="_blank">after</a> selector to the class or id selector of an object and then it displays the &#8216;content&#8217; property you supply in that position. In this example I am attaching it after the div with the id header, #header. Your theme may differ in its naming convention but header is very likely. You could also attach it elsewhere, before the header, after a menu or before a logo image for example. Just make sure it is part of your sites header section so that it appears on all pages.</p>
<div class ="myCode">
<pre class="brush: css; title: ; notranslate">
/* add the message and style it*/
#header:after {
     border: 1px solid #FF0000;
     color: #FF0000;
     content: &quot;Sorry folks we are on vacation, we will be accepting orders again May 1st 2013 &quot;;/*this is your message*/
     font-size: 1.5em;
     padding: 5px;
}
</pre>
</div>
<p><br/></p>
<p>Now there are simple ways to stop people ordering. You can just go to Settings/Store/Presentation Tab and check &#8220;hide add to cart button&#8221; That will do the job, no one can buy, but that is going to be quite confusing if you provide the user with no more information. So lets leave that setting alone and do a little CSS which will allow you to display a message on every single product page where the button was, without having to edit each product page individually. We can also use CSS to hide the &#8216;Add to cart&#8217; button.</p>
<p>I am hiding the button rather than turning it off because I can then connect my CSS message to the &#8216;Add to cart&#8217; buttons containing div. A bit of trial and error and I thought this was the best option to connect the message to. To explain the CSS a little the &#8216;:before&#8217; is attached to the class selector &#8216;.wpsc_buy_button_container&#8217; for the div that contains the button. Then we hide the button input itself. If you just turn the button off in settings the button container div is not created and you have nothing to attach your message to.</p>
<div class ="myCode">
<pre class="brush: css; title: ; notranslate">
/* add the message and style it*/
.wpsc_buy_button_container:before {
     background-color: #E8E8E8;
     border: 1px solid #FF0000;
     color: #FF0000;
     content: &quot;Accepting orders again May 1st 2013 &quot;;/*this is your message*/
     float: left;
     padding: 5px;
     text-align: left;
}
/*hide the button*/
#content input.wpsc_buy_button {
     display: none ! important;
}
</pre>
</div>
<p><br/><br />
This code would go in your custom CSS file if using one or if using a &#8216;Storefront&#8217; theme you could put it in the Storefront Options/Style Tab/Custom CSS box.</p>
<p>Your single product page will show the header and button replacing text<br />
<img src="http://gasolicious.com/wp-content/uploads/2013/04/site_closed.jpg" alt="adding site temporarily closed to WP e-Commerce site" width="940" height="965" class="alignleft size-full wp-image-2167" />
<a rel="prettyPhoto[slides]" href='http://gasolicious.com/temporarily-close-your-wp-e-commerce-store/site_closed-2/' title='site_closed'><img width="150" height="150" src="http://gasolicious.com/wp-content/uploads/2013/04/site_closed-150x150.jpg" class="attachment-thumbnail" alt="adding site temporarily closed to WP e-Commerce site" /></a>
</p>
<h4>Checkout</h4>
<p>You could also temporarily change the content on the checkout page, switch to text view (html in older versions of WordPress) remove the shortcode [shoppingcart] and add some nice content advising your customers you are temporarily closed and when you will return. Be chatty and personal, explain  why you are closed and when you will be back in a little more detail, add some nice images of your products or really rub the vacation in with a photograph of that beach you will be laying on. I would say this is a good idea especially if your theme has a link to the shopping cart/checkout page displayed or uses the cart widget which allows navigation to checkout. You could skip this. No one can order, so even if they do get to checkout they will just see the &#8220;you have nothing in your cart&#8221; message.</p>
<p>Instead of editing the checkout page directly You could make a separate page and use a redirect plugin to send all checkout page requests to your notice page. As the restoration of checkout just involves restoring the simple [shoppingcart] shortcode, unless you are already using a redirect plugin that seems a little over-kill.</p>
<p></p>
<div  class ="note-panel">
<h4>Custom CSS:</h4>
<p>This code belongs in your Custom CSS file. If using a Storefront Theme you can also just paste this code in the &#8220;Custom CSS&#8221; box in the Storefront options panel on the Style tab.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/temporarily-close-your-wp-e-commerce-store/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WP e-Commerce and GoldCart replace $0.00 prices with message.</title>
		<link>http://gasolicious.com/wp-e-commerce-and-goldcart-replace-0-00-prices-with-message/</link>
		<comments>http://gasolicious.com/wp-e-commerce-and-goldcart-replace-0-00-prices-with-message/#comments</comments>
		<pubDate>Tue, 02 Apr 2013 03:00:16 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[E-Commerce]]></category>
		<category><![CDATA[Gold Cart]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=2104</guid>
		<description><![CDATA[The question I&#8217;ve been searching for some code so that if the price is £0.00, then a piece of text along the lines of &#8216;Price on application&#8217; is pulled through. I have found this post on your site and attempted to make it work. I think the different plugin versions mean that I can&#8217;t get [...]]]></description>
				<content:encoded><![CDATA[<h4>The question</h4>
<p>I&#8217;ve been searching for some code so that if the price is £0.00, then a piece of text along the lines of &#8216;Price on application&#8217; is pulled through. </p>
<p>I have found <a href="http://gasolicious.com/e-commerce-wpec-zero-free/" title="link to post on adding free if price zero in WPEC 3.8.8.5">this post</a> on your site and attempted to make it work. I think the different plugin versions mean that I can&#8217;t get it right.<br />
I am using WP eCommerce Version 3.8.9.5<br />
and Gold Cart Version 2.9.7.3 </p>
<h4>Answer</h4>
<p>This answer assumes you have a theme which uses the default template files from the WP e-Commerce plugin. This is quite common. (If you have a theme which includes custom versions of these files you will have to attempt to apply this code to your theme.)<br />
Depending on your setup there are 4 PHP files you may need to edit. If you have never edited PHP see the Tools panel at the end of this post and jump in. The four files are</p>
<ol>
<li>wpsc-products_page.php</li>
<li>wpsc-single_product.php</li>
<li>wpsc-list_view.php</li>
<li>wpsc-grid_view.php</li>
</ol>
<p>If you are NOT using the Gold Cart plugin you should alter the first two. If you are using Gold Cart you will want to alter 2 and either 3 or 4 depending on which view you have set in WP e-Commerce on Settings/Store/Presentation tab for &#8220;Product Display:&#8221;<br />
I recommend just altering all four actually. That way if you decide to change your settings later it will just work and you will not have to remember where you found this code! You can of course replace the message &#8220;Price on application&#8221; in the code below with any message you desire.</p>
<div  class ="note-panel">
<h4>First copy the files</h4>
<p>In the WordPress backend go to Settings/Store/Presentation tab, in the advanced settings panel in the list of files check the four from the list above. If you do not have Gold Cart you will only see 1 and 2. Then click the &#8216;Move Template Files&#8221; button. This will copy the four files to your theme folder. You can modify them there. The modified ones from your theme folder will load, over-riding the ones from WP e-Commerce. This means you can update the plugin without over-writing your changes.
</p></div>
<p><br/></p>
<h4>Code file 1</h4>
<p>I am going to add big chunks of code here on the first example to help you understand what you are looking for. After that I will make the code examples shorter. Open wpsc-single_product.php from your theme folder. Find the highlighted line around line 140.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 128; highlight: [140]; title: ; notranslate">
							&lt;div class=&quot;wpsc_product_price&quot;&gt;
								&lt;?php if(wpsc_show_stock_availability()): ?&gt;
									&lt;?php if(wpsc_product_has_stock()) : ?&gt;
										&lt;div id=&quot;stock_display_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot; class=&quot;in_stock&quot;&gt;&lt;?php _e('Product in stock', 'wpsc'); ?&gt;&lt;/div&gt;
									&lt;?php else: ?&gt;
										&lt;div id=&quot;stock_display_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot; class=&quot;out_of_stock&quot;&gt;&lt;?php _e('Product not in stock', 'wpsc'); ?&gt;&lt;/div&gt;
									&lt;?php endif; ?&gt;
								&lt;?php endif; ?&gt;
								&lt;?php if(wpsc_product_is_donation()) : ?&gt;
									&lt;label for=&quot;donation_price_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot;&gt;&lt;?php _e('Donation', 'wpsc'); ?&gt;: &lt;/label&gt;
									&lt;input type=&quot;text&quot; id=&quot;donation_price_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot; name=&quot;donation_price&quot; value=&quot;&lt;?php echo wpsc_calculate_price(wpsc_the_product_id()); ?&gt;&quot; size=&quot;6&quot; /&gt;
								&lt;?php else : ?&gt;
									&lt;?php wpsc_the_product_price_display(); ?&gt;
									 &lt;!-- multi currency code --&gt;
                                    &lt;?php if(wpsc_product_has_multicurrency()) : ?&gt;
	                                    &lt;?php echo wpsc_display_product_multicurrency(); ?&gt;
                                    &lt;?php endif; ?&gt;
									&lt;?php if(wpsc_show_pnp()) : ?&gt;
										&lt;p class=&quot;pricedisplay&quot;&gt;&lt;?php _e('Shipping', 'wpsc'); ?&gt;:&lt;span class=&quot;pp_price&quot;&gt;&lt;?php echo wpsc_product_postage_and_packaging(); ?&gt;&lt;/span&gt;&lt;/p&gt;
									&lt;?php endif; ?&gt;
								&lt;?php endif; ?&gt;
							&lt;/div&gt;&lt;!--close wpsc_product_price--&gt;
</pre>
</div>
<p>Replace that line with the code highlighted below</p>
<div class ="myCode">
<pre class="brush: php; first-line: 128; highlight: [140,141,142,143,144,145,146]; title: ; notranslate">
							&lt;div class=&quot;wpsc_product_price&quot;&gt;
								&lt;?php if(wpsc_show_stock_availability()): ?&gt;
									&lt;?php if(wpsc_product_has_stock()) : ?&gt;
										&lt;div id=&quot;stock_display_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot; class=&quot;in_stock&quot;&gt;&lt;?php _e('Product in stock', 'wpsc'); ?&gt;&lt;/div&gt;
									&lt;?php else: ?&gt;
										&lt;div id=&quot;stock_display_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot; class=&quot;out_of_stock&quot;&gt;&lt;?php _e('Product not in stock', 'wpsc'); ?&gt;&lt;/div&gt;
									&lt;?php endif; ?&gt;
								&lt;?php endif; ?&gt;
								&lt;?php if(wpsc_product_is_donation()) : ?&gt;
									&lt;label for=&quot;donation_price_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot;&gt;&lt;?php _e('Donation', 'wpsc'); ?&gt;: &lt;/label&gt;
									&lt;input type=&quot;text&quot; id=&quot;donation_price_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot; name=&quot;donation_price&quot; value=&quot;&lt;?php echo wpsc_calculate_price(wpsc_the_product_id()); ?&gt;&quot; size=&quot;6&quot; /&gt;
								&lt;?php else : ?&gt;
									&lt;?php
									if (wpsc_the_product_price() != '$0.00'){
                        		 wpsc_the_product_price_display();
						  }
								else {
								_e('Price on application', 'wpsc');
								}?&gt;
									 &lt;!-- multi currency code --&gt;
                                    &lt;?php if(wpsc_product_has_multicurrency()) : ?&gt;
	                                    &lt;?php echo wpsc_display_product_multicurrency(); ?&gt;
                                    &lt;?php endif; ?&gt;
									&lt;?php if(wpsc_show_pnp()) : ?&gt;
										&lt;p class=&quot;pricedisplay&quot;&gt;&lt;?php _e('Shipping', 'wpsc'); ?&gt;:&lt;span class=&quot;pp_price&quot;&gt;&lt;?php echo wpsc_product_postage_and_packaging(); ?&gt;&lt;/span&gt;&lt;/p&gt;
									&lt;?php endif; ?&gt;
								&lt;?php endif; ?&gt;
							&lt;/div&gt;&lt;!--close wpsc_product_price--&gt;
</pre>
</div>
<p></p>
<div  class ="note-panel">
<h5>Watch out, if not using $ as your currency, remember to change that in the code</h5>
<p>If you do not the code will not detect a match. For example $0.00 will not match £0.00 and the price will not be removed.</p></div>
<p><br/></p>
<h4>Code file 2</h4>
<p>For the products page when not using Gold Cart you need to edit wpsc-products_page.php. Find the highlighted line around 172.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 171; highlight: [172]; title: ; notranslate">
								&lt;?php else : ?&gt;
									&lt;?php wpsc_the_product_price_display(); ?&gt;

</pre>
</div>
<p>Replace that line 172 with the code below</p>
<div class ="myCode">
<pre class="brush: php; first-line: 171; highlight: [172,173,174,175,176,177,178]; title: ; notranslate">
							&lt;?php else : ?&gt;
&lt;?php
									if (wpsc_the_product_price() != '$0.00'){
                        		 wpsc_the_product_price_display();
						  }
								else {
								_e('Price on application', 'wpsc');
								}?&gt;
</pre>
</div>
<p><br/></p>
<h4>Code file 3</h4>
<p>When using Gold Cart for the list view you need to edit wpsc-list_view.php. Find the highlighted line around 92.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 91; highlight: [92]; title: ; notranslate">
					&lt;td class='wpsc_price_td'&gt;
						&lt;?php wpsc_the_product_price_display( array( 'output_you_save' =&gt; false ) ); ?&gt;
					&lt;/td&gt;
</pre>
</div>
<p>Replace line 92 with the highlighted code below</p>
<div class ="myCode">
<pre class="brush: php; first-line: 91; highlight: [92,93,94,95,96,97,98]; title: ; notranslate">
					&lt;td class='wpsc_price_td'&gt;
                    &lt;?php  
									if (wpsc_the_product_price() != '$0.00'){
                        		 wpsc_the_product_price_display();
						  }
								else {
								_e('Price on application', 'wpsc');
								}?&gt;
					&lt;/td&gt;
</pre>
</div>
<p><br/></p>
<h4>Code file 4</h4>
<p>When using Gold Cart for the grid view you need to edit wpsc-grid_view.php. Find the highlighted line around 88.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 87; highlight: [88]; title: ; notranslate">
                        	&lt;div class=&quot;price_container&quot;&gt;
                        		&lt;?php wpsc_the_product_price_display( array( 'output_you_save' =&gt; false ) ); ?&gt;
					&lt;/td&gt;
</pre>
</div>
<p>Replace line 88 with the highlighted code below</p>
<div class ="myCode">
<pre class="brush: php; first-line: 87; highlight: [88,89,90,91,92,93]; title: ; notranslate">
                        	&lt;div class=&quot;price_container&quot;&gt;
                          &lt;?php  if (wpsc_the_product_price() != '$0.00'){
                        		 wpsc_the_product_price_display( array( 'output_you_save' =&gt; false ) );
						  }
								else {
								_e('Price on application', 'wpsc');
								}?&gt;
</pre>
</div>
<p><br/></p>
<h4>What if it needs to be a link?</h4>
<p>If for instance this is used as &#8216;Price on application&#8217; like in the code and your site has a contact form, why not have the text link to that page? You will need something like below. Change the URL to match that of the contact page on your site. This is the basic concept, each of the examples above varies slightly. You can work it out. I can&#8217;t do all of the work for you. basically in all 4 bits of the code I provide above<br />
You replace this</p>
<div class ="myCode">
<pre class="brush: php; title: ; notranslate">
								else {
								_e('Price on application', 'wpsc');
								}?&gt;
</pre>
</div>
<p>with this</p>
<div class ="myCode">
<pre class="brush: php; title: ; notranslate">
								else { ?&gt;
                                &lt;p class = &quot;pricedisplay wpsc-product-price&quot;&gt;
								&lt;span class = &quot;currentprice pricedisplay&quot;&gt; &lt;a class=&quot;poa&quot; href=&quot;http://mysite/contact/&quot;&gt;&lt;?php _e('Price on application', 'wpsc'); ?&gt;&lt;/a&gt;&lt;/span&gt;
                                &lt;/p&gt;
								&lt;?php }?&gt;
</pre>
</div>
<p><br/></p>
<h4>Some CSS</h4>
<p>I am using the same classes as WP e-Commerce so most formatting will match. You then have a new class &#8216;poa&#8217; on the link. You can use this to style it. For example make it red and add some space above and below.</p>
<div class ="myCode">
<pre class="brush: css; title: ; notranslate">
.poa{
color:#ff0000;
line-height:2em;
}
</pre>
</div>
<p><br/></p>
<div  class ="note-panel">
<h4>Tools:</h4>
<p>You may edit your PHP outside WordPress and upload it to your server. You must use an appropriate code editor NOT microsoft word or anything like that which adds a lot of invisible formatting and will be a disaster.<br />
If you do not have one, 2 excellent free ones are&#8230;<br />
TextWrangler for Mac, http://www.barebones.com/products/textwrangler/<br />
Notepad++ for the PC http://notepad-plus-plus.org/
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/wp-e-commerce-and-goldcart-replace-0-00-prices-with-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP_Query how to display posts from a specific Category</title>
		<link>http://gasolicious.com/wp_query-display-posts-specific-category/</link>
		<comments>http://gasolicious.com/wp_query-display-posts-specific-category/#comments</comments>
		<pubDate>Mon, 24 Dec 2012 00:56:52 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=2091</guid>
		<description><![CDATA[I received a question about how to display posts from a specific category. You may want to do this in a newspaper style layout or just to show a featured category on your homepage. You need to use WP_Query There are 2 numbers in the line of code highlighted below which are the arguments we [...]]]></description>
				<content:encoded><![CDATA[<p>I received a question about how to display posts from a specific category. You may want to do this in a newspaper style layout or just to show a featured category on your homepage. You need to use <a href="http://codex.wordpress.org/Class_Reference/WP_Query" title="Link to WP_Query page in the WordPress codex" target="_blank">WP_Query</a></p>
<p>There are 2 numbers in the line of code highlighted below which are the arguments we pass to WP_Query. The first is the category ID and the second is the number of posts to show. Change them to the values you want. You can find the ID for your category by opening it for editing in the WordPress backend and looking in the uRL bar in your browser.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 1; highlight: [2]; title: ; notranslate">
&lt;?php
$catquery = new WP_Query( 'cat=3&amp;posts_per_page=10' );
while($catquery-&gt;have_posts()) : $catquery-&gt;the_post();
?&gt;
&lt;ul&gt;
&lt;li&gt;&lt;h3&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;&lt;?php the_content(); ?&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;?php endwhile; ?&gt;

</pre>
</div>
<p>Below is some slightly different code which I used to just display one post in a div on my home page. I used a 2 column layout and displayed the page content on the left and 1 post from a category named &#8216;featured&#8217; in a column on the right. This was used in a child theme for popular <a href="http://yoko.elmastudio.de/" title="Link to demo of the free responsive WordPress theme Yoko." target="_blank">free responsive theme Yoko</a>. You can download it in the WordPress theme repository. This is the complete page code.<br />
Note that I have used the category name to fetch the id. This way I can re-use this code as long as I make the category name &#8216;featured&#8217; I do not need to worry about what the ID is on a new site. see the highlighted lines below.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 1; highlight: [25,26]; title: ; notranslate">
&lt;?php
/**
 * Template Name: Home-page
 * Description: For homepage with column for specified blog post
 *
 * @package WordPress
 * @subpackage Yoko
 */

get_header(); ?&gt;

&lt;div id=&quot;wrap&quot;&gt;

			&lt;div id=&quot;home-page-content&quot; class=&quot;half-width half-left&quot;&gt;

				&lt;?php the_post(); ?&gt;
				&lt;?php get_template_part( 'content', 'page' ); ?&gt;
				
				&lt;?php comments_template( '', true ); ?&gt;
				
			&lt;/div&gt;&lt;!-- end home-page-content --&gt;
            
            &lt;div id=&quot;home-post-content&quot; class=&quot;half-width half-right&quot;&gt;
				&lt;?php
				$category_id = get_cat_ID('featured');
                $catquery = new WP_Query( 'cat=' .$category_id. '&amp;posts_per_page=1' );
                while($catquery-&gt;have_posts()) : $catquery-&gt;the_post();
                ?&gt;
                &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;
                
                &lt;?php the_content(); ?&gt;
                
                &lt;?php endwhile; ?&gt;
                                
                                &lt;?php comments_template( '', true ); ?&gt;
				
			&lt;/div&gt;&lt;!-- end home-post-content --&gt;
				
&lt;?php get_footer(); ?&gt;
</pre>
</div>
<h4>Make it all fit with CSS</h4>
<p>Now you just need a little CSS to make the columns fit. This works fro Yoko, you would need to have some more CSS in the media queries to account for smaller screens and to control text sizes. This is only a guide as the real purpose of this post is explaining how to get post from 1 category.</p>
<div class ="myCode">
<pre class="brush: css; title: ; notranslate">
.half-width {
	width:48%;
	padding: 0 0 20px 0;
	border-bottom: none;
	float:left;
}

.half-left {
	margin: 0 2% 0 0;
}

.half-right {
	margin: 0 0 0 2%;
}

#home-page-content, #home-post-content {
	font-size: .95em;
	line-height: 1.6;
}

#home-page-content .page p, #home-post-content p {
	padding: 0 0 20px 0;
}
</pre>
</div>
<p></p>
<div  class ="note-panel">
<h4>Tools:</h4>
<p>You may edit your PHP outside WordPress and upload it to your server. You must use an appropriate code editor NOT microsoft word or anything like that which adds a lot of invisible formatting and will be a disaster.<br />
If you do not have one, 2 excellent free ones are&#8230;<br />
TextWrangler for Mac, http://www.barebones.com/products/textwrangler/<br />
Notepad++ for the PC http://notepad-plus-plus.org/</p>
<h4>Custom CSS:</h4>
<p>This code belongs in your Custom CSS file. Don&#8217;t have a custom.css? There is an empty one for you to use in the theme folder? You can edit custom.css by going to Appearance/Editor and choosing custom.css from the list of files.<br />
You can also just paste this code in the &#8220;Custom CSS&#8221; box in the Storefront options panel on the Style tab if you will not be making many changes, but it is a bit hard to work with there.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/wp_query-display-posts-specific-category/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Storefront Elegance theme. Change the size of the homepage slider</title>
		<link>http://gasolicious.com/storefront-elegance-theme-slider-size/</link>
		<comments>http://gasolicious.com/storefront-elegance-theme-slider-size/#comments</comments>
		<pubDate>Mon, 26 Nov 2012 21:36:22 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Elegance]]></category>
		<category><![CDATA[Storefront Themes]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=2082</guid>
		<description><![CDATA[I have had a couple of people ask how to change the size of the slider on the homepage of Storefronts Elegance theme. So prepare to venture into some PHP code. This is really easy stuff, just changing a couple of numbers, show no fear and jump in even if you have never done it [...]]]></description>
				<content:encoded><![CDATA[<p>I have had a couple of people ask how to change the size of the slider on the homepage of Storefronts Elegance theme. So prepare to venture into some PHP code. This is really easy stuff, just changing a couple of numbers, show no fear and jump in even if you have never done it before.<br />
New to PHP editing? see the Tools note at the end of this post</p>
<p>The line numbers here may change in other versions but I show enough code for you to be able to find the relevant parts, the code probably will not change much. You will need to maintain the PHP file when there are theme updates so keep a copy of it and what changes you made. The example code is from Elegance version 1.4.5.<br />
On to the good stuff, you need to edit tpl-homepage.php which is in your theme folder. <strong>First make a backup copy of this file somewhere!</strong></p>
<p>There are 2 numbers in the line of code highlighted below which are width and height in pixels. Change them to the values you want.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 20; highlight: [29]; title: ; notranslate">
&lt;div id=&quot;slider-frame&quot;&gt;
	&lt;div id=&quot;slider&quot; class=&quot;nivoSlider&quot;&gt;
			&lt;?php //BEGIN Slider LOOP
			$loop = new WP_Query( array( 'post_type' =&gt; 'slide' ) );
			while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post();
			$buttontext = get_post_meta($post-&gt;ID, &quot;text&quot;, true);
			$buttonlink = get_post_meta($post-&gt;ID, &quot;link&quot;, true);
			if(has_post_thumbnail()) {
			$thumb = get_post_thumbnail_id();
			$image = vt_resize( $thumb, '', 946, 360, true );
			}
			?&gt;
			&lt;a href=&quot;&lt;?php echo $buttonlink; ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;img alt=&quot;&lt;?php the_title(); ?&gt;&quot; title=&quot;&lt;?php echo $buttontext; ?&gt;&quot; src=&quot;&lt;?php echo $image['url']; ?&gt;&quot; width=&quot;&lt;?php echo $image['width']; ?&gt;&quot; height=&quot;&lt;?php echo $image['height']; ?&gt;&quot; /&gt;&lt;/a&gt;
			
			&lt;?php endwhile; //END SLIDER LOOP ?&gt;

	&lt;/div&gt;&lt;!-- /#slider --&gt;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

</pre>
</div>
<p>Close and save the file. You should be done. Remember if you mess up just replace the file with that backup copy you saved. You did save one right! Now you need to add some CSS.</p>
<h4>Make it all fit with CSS</h4>
<p>Now you just need a little CSS to make the slider fit. If you only changed the height the second slider margin: 0 auto rule is not required. See the notes below for where to put this code.</p>
<div class ="myCode">
<pre class="brush: css; title: ; notranslate">
#slider img, #slider a, #slider a img, #slider {
height: 360px;
width: 946px;
}
/* center slider on page */
#slider {
margin: 0 auto;
}
</pre>
</div>
<p></p>
<div  class ="note-panel">
<h4>Tools:</h4>
<p>You may edit your PHP outside WordPress and upload it to your server. You must use an appropriate code editor NOT microsoft word or anything like that which adds a lot of invisible formatting and will be a disaster.<br />
If you do not have one, 2 excellent free ones are&#8230;<br />
TextWrangler for Mac, http://www.barebones.com/products/textwrangler/<br />
Notepad++ for the PC http://notepad-plus-plus.org/</p>
<h4>Custom CSS:</h4>
<p>This code belongs in your Custom CSS file. Don&#8217;t have a custom.css? There is an empty one for you to use in the theme folder? You can edit custom.css by going to Appearance/Editor and choosing custom.css from the list of files.<br />
You can also just paste this code in the &#8220;Custom CSS&#8221; box in the Storefront options panel on the Style tab if you will not be making many changes, but it is a bit hard to work with there.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/storefront-elegance-theme-slider-size/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Storefront themes, Boutique theme, add a right sidebar to your blog</title>
		<link>http://gasolicious.com/storefront-boutique-theme-sidebar/</link>
		<comments>http://gasolicious.com/storefront-boutique-theme-sidebar/#comments</comments>
		<pubDate>Thu, 08 Nov 2012 01:40:15 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Boutique]]></category>
		<category><![CDATA[Storefront Themes]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Storefront]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=2067</guid>
		<description><![CDATA[The question Here&#8217;s my issue: I want my blog page to actually LOOK like a blog, instead of like another store page. But because it&#8217;s just a page with posts, it doesn&#8217;t really look like a blog, and it doesn&#8217;t really function like a blog. Answer This is not too hard but does involve editing [...]]]></description>
				<content:encoded><![CDATA[<h4>The question</h4>
<p>Here&#8217;s my issue: I want my blog page to actually LOOK like a blog, instead of like another store page. But because it&#8217;s just a page with posts, it doesn&#8217;t really look like a blog, and it doesn&#8217;t really function like a blog.</p>
<h4>Answer</h4>
<p>This is not too hard but does involve editing 3 PHP files and adding a little CSS. If you have never edited PHP see the notes and tools at the end of this post. This code id for Boutique version 1.2.3 but should be basically the same in any version. The line numbers may be slightly different.</p>
<h4>Code Theme Functions PHP file</h4>
<p>Open theme-functions.php which is in the Designer theme folder, sub folder &#8220;includes&#8221;. Find &#8220;WIDGET AREAS&#8221; around line 43. You will see 4 blocks of code that are basically the same except for the name. Each of these is a widget area on the home page. You need to add 1 more to be a sidebar. So you copy the last block and paste it below itself. Then give that block anew name, I used &#8220;Sidebar Widgets&#8221;. The completed code is shown below</p>
<div class ="myCode">
<pre class="brush: php; first-line: 42; highlight: [79,80,81,82,83,84,85,86]; title: ; notranslate">
===============================================================
WIDGET AREAS
===============================================================
*/

if ( function_exists('register_sidebar') )
    register_sidebar(array(
    	'name'=&gt;'Home Widget 1',
        'before_widget' =&gt; '&lt;div class=&quot;widget&quot;&gt;',
        'after_widget' =&gt; '&lt;/div&gt;',
        'before_title' =&gt; '&lt;h2&gt;',
        'after_title' =&gt; '&lt;/h2&gt;',
    ));
if ( function_exists('register_sidebar') )
    register_sidebar(array(
    	'name'=&gt;'Home Widget 2',
        'before_widget' =&gt; '&lt;div class=&quot;widget&quot;&gt;',
        'after_widget' =&gt; '&lt;/div&gt;',
        'before_title' =&gt; '&lt;h2&gt;',
        'after_title' =&gt; '&lt;/h2&gt;',
    ));
if ( function_exists('register_sidebar') )
    register_sidebar(array(
    	'name'=&gt;'Home Widget 3',
        'before_widget' =&gt; '&lt;div class=&quot;widget&quot;&gt;',
        'after_widget' =&gt; '&lt;/div&gt;',
        'before_title' =&gt; '&lt;h2&gt;',
        'after_title' =&gt; '&lt;/h2&gt;',
    ));
if ( function_exists('register_sidebar') )
    register_sidebar(array(
    	'name'=&gt;'Home Widget 4',
        'before_widget' =&gt; '&lt;div class=&quot;widget&quot;&gt;',
        'after_widget' =&gt; '&lt;/div&gt;',
        'before_title' =&gt; '&lt;h2&gt;',
        'after_title' =&gt; '&lt;/h2&gt;',
    ));
if ( function_exists('register_sidebar') )
    register_sidebar(array(
    	'name'=&gt;'Sidebar Widgets',
        'before_widget' =&gt; '&lt;div class=&quot;widget&quot;&gt;',
        'after_widget' =&gt; '&lt;/div&gt;',
        'before_title' =&gt; '&lt;h2&gt;',
        'after_title' =&gt; '&lt;/h2&gt;',
    ));
</pre>
</div>
<p>
At this point you will have a new widget area in the WorPress backend under Appearance/Widgets named &#8220;Sidebar Widgets&#8221;. You can add and remove widgets but nothing will appear in the front end until we add the sidebar area to the templates.</p>
<h4>Code index PHP file</h4>
<p>Open index.php which is in the Designer theme folder. It consists of only 11 lines of code. This is the file that displays your main &#8220;Blog&#8221; page with multiple posts listed. First delete line 6 which is highlighted below.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 1; highlight: [6]; title: ; notranslate">
&lt;?php get_header(); ?&gt;
&lt;div id=&quot;container&quot; class=&quot;container_12&quot;&gt;
	&lt;div id=&quot;content&quot; class=&quot;grid_12 sft-framed-item&quot;&gt;
		&lt;div class=&quot;sft-framed-inner&quot;&gt;
			&lt;?php include(TEMPLATEPATH . '/includes/loop-post-archives.php'); ?&gt;
			&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
		&lt;/div&gt;&lt;!-- end content inner --&gt;
	&lt;/div&gt;&lt;!-- end content --&gt;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;?php get_footer(); ?&gt;
</pre>
</div>
<p>
We are going to add a block of just 6 lines of code to add our sidebar. This code just creates a sidebar div and calls our sidebar. The completed code is shown below, the highlighted part is what you add to create the sidebar. Note it does not go where you deleted line 6. You can copy and paste.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 1; highlight: [7,8,9,10,11,12]; title: ; notranslate">
&lt;?php get_header(); ?&gt;
&lt;div id=&quot;container&quot; class=&quot;container_12&quot;&gt;
	&lt;div id=&quot;content&quot; class=&quot;grid_12 sft-framed-item&quot;&gt;
		&lt;div class=&quot;sft-framed-inner&quot;&gt;
			&lt;?php include(TEMPLATEPATH . '/includes/loop-post-archives.php'); ?&gt;
		&lt;/div&gt;&lt;!-- end content inner --&gt;
                    &lt;div class =&quot;right-sidebar&quot;&gt;
            &lt;?php if ( !function_exists('dynamic_sidebar') ||
           !dynamic_sidebar('Sidebar Widgets') ) : ?&gt;
  &lt;!-- This will be displayed if the sidebar is empty --&gt;
&lt;?php endif; ?&gt;
            &lt;/div&gt;
	&lt;/div&gt;&lt;!-- end content --&gt;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;?php get_footer(); ?&gt;
</pre>
</div>
<p></p>
<h4>Code single PHP file</h4>
<p>Open single.php which is in the Designer theme folder. It consists of only 14 lines of code. This is the file that displays your individual full blog posts. you do not need to delete anything in this file. You just add the same 6 lines as you did to index.php. They are already added and highlighted in the code below</p>
<div class ="myCode">
<pre class="brush: php; first-line: 1; highlight: [11,12,13,14,15,16]; title: ; notranslate">
&lt;?php get_header(); ?&gt;
&lt;div id=&quot;container&quot; class=&quot;container_12&quot;&gt;
	&lt;div id=&quot;content&quot; class=&quot;grid_12 sft-framed-item&quot;&gt;
		&lt;div class=&quot;sft-framed-inner&quot;&gt;
		&lt;?php include(TEMPLATEPATH . '/includes/loop-post-single.php'); ?&gt;
					&lt;div id=&quot;nav-below&quot; class=&quot;navigation&quot;&gt;
					&lt;div class=&quot;nav-previous&quot;&gt;&lt;?php previous_post_link( '%link', '&lt;span class=&quot;meta-nav&quot;&gt;' . _x( '&amp;larr;', 'Previous post link', 'storefront' ) . '&lt;/span&gt; %title' ); ?&gt;&lt;/div&gt;
					&lt;div class=&quot;nav-next&quot;&gt;&lt;?php next_post_link( '%link', '%title &lt;span class=&quot;meta-nav&quot;&gt;' . _x( '&amp;rarr;', 'Next post link', 'storefront' ) . '&lt;/span&gt;' ); ?&gt;&lt;/div&gt;
				&lt;/div&gt;&lt;!-- #nav-below --&gt;
		&lt;/div&gt;
        &lt;div class =&quot;right-sidebar&quot;&gt;
            &lt;?php if ( !function_exists('dynamic_sidebar') ||
           !dynamic_sidebar('Sidebar Widgets') ) : ?&gt;
  &lt;!-- This will be displayed if the sidebar is empty --&gt;
&lt;?php endif; ?&gt;
            &lt;/div&gt;
	&lt;/div&gt;&lt;!-- end content --&gt;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;?php get_footer(); ?&gt;
</pre>
</div>
<p></p>
<h4>Make it all fit with CSS</h4>
<p>Now you just need a little CSS to make the blog posts narrower to allow room for a sidebar and to float the sidebar next to the posts.</p>
<div class ="myCode">
<pre class="brush: css; title: ; notranslate">
.sft-framed-inner{
     float: left;
     width: 540px;
}
.right-sidebar{
float:right;
margin-right:20px;
}
</pre>
</div>
<p></p>
<div  class ="note-panel">
<h4>Tools:</h4>
<p>You may edit your PHP outside WordPress and upload it to your server. You must use an appropriate code editor NOT microsoft word or anything like that which adds a lot of invisible formatting and will be a disaster.<br />
If you do not have one, 2 excellent free ones are&#8230;<br />
TextWrangler for Mac, http://www.barebones.com/products/textwrangler/<br />
Notepad++ for the PC http://notepad-plus-plus.org/</p>
<h4>Custom CSS:</h4>
<p>This code belongs in your Custom CSS file. Don&#8217;t have a custom.css? There is an empty one for you to use in the theme folder? You can edit custom.css by going to Appearance/Editor and choosing custom.css from the list of files.<br />
You can also just paste this code in the &#8220;Custom CSS&#8221; box in the Storefront options panel on the Style tab if you will not be making many changes, but it is a bit hard to work with there.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/storefront-boutique-theme-sidebar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Storefront Gridport theme, limit search to products and add pagination</title>
		<link>http://gasolicious.com/gridport-theme-search-pagination/</link>
		<comments>http://gasolicious.com/gridport-theme-search-pagination/#comments</comments>
		<pubDate>Mon, 29 Oct 2012 08:56:56 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Gridport]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=2044</guid>
		<description><![CDATA[Adding attractive pagination This does require that search only have one loop and return one set of posts. Here the custom post type Product. It will not return any regular pages or Blog posts. It may be able to be adapted to do that. I do not have the time to work that out. If [...]]]></description>
				<content:encoded><![CDATA[<h4>Adding attractive pagination</h4>
<p>This does require that search only have one loop and return one set of posts. Here the custom post type Product. It will not return any regular pages or Blog posts. It may be able to be adapted to do that. I do not have the time to work that out. If this works for you great, if not you will need a developer.</p>
<h4>The PHP code</h4>
<p>First you need to add a function to your functions.php file. This you will find in the Gridport theme folder. Make sure you have a copy of the original functions.php file in case you have problems. If you have not edited PHP before see the notes at the end of this file, do not be scared you can copy and paste. Make a blank line right before the last line which is ?>; in functions.php and copy and paste the code below. Make sure you have no spaces or blank lines after the closing ?></p>
<div class="myCode">
<pre class="brush: php; first-line: 56; title: ; notranslate">
function storefront_pagination($pages = '', $range = 3)
{  
     $showitems = ($range * 2)+1;  
 
     global $paged;
     if(empty($paged)) $paged = 1;
 
     if($pages == '')
     {
         global $wp_query;
         $pages = $wp_query-&gt;max_num_pages;
         if(!$pages)
         {
             $pages = 1;
         }
     }   
 
     if(1 != $pages)
     {
         echo &quot;&lt;div class=\&quot;pagination-search\&quot;&gt;&lt;span&gt;Page &quot;.$paged.&quot; of &quot;.$pages.&quot;&lt;/span&gt;&quot;;
         if($paged &gt; 2 &amp;&amp; $paged &gt; $range+1 &amp;&amp; $showitems &lt; $pages) echo &quot;&lt;a href='&quot;.get_pagenum_link(1).&quot;'&gt;&amp;laquo; First&lt;/a&gt;&quot;;
         if($paged &gt; 1 &amp;&amp; $showitems &lt; $pages) echo &quot;&lt;a href='&quot;.get_pagenum_link($paged - 1).&quot;'&gt;&amp;lsaquo; Previous&lt;/a&gt;&quot;;
 
         for ($i=1; $i &lt;= $pages; $i++)
         {
             if (1 != $pages &amp;&amp;( !($i &gt;= $paged+$range+1 || $i &lt;= $paged-$range-1) || $pages &lt;= $showitems ))
             {
                 echo ($paged == $i)? &quot;&lt;span class=\&quot;current\&quot;&gt;&quot;.$i.&quot;&lt;/span&gt;&quot;:&quot;&lt;a href='&quot;.get_pagenum_link($i).&quot;' class=\&quot;inactive\&quot;&gt;&quot;.$i.&quot;&lt;/a&gt;&quot;;
             }
         }
 
         if ($paged &lt; $pages &amp;&amp; $showitems &lt; $pages) echo &quot;&lt;a href=\&quot;&quot;.get_pagenum_link($paged + 1).&quot;\&quot;&gt;Next &amp;rsaquo;&lt;/a&gt;&quot;;  
         if ($paged &lt; $pages-1 &amp;&amp;  $paged+$range-1 &lt; $pages &amp;&amp; $showitems &lt; $pages) echo &quot;&lt;a href='&quot;.get_pagenum_link($pages).&quot;'&gt;Last &amp;raquo;&lt;/a&gt;&quot;;
         echo &quot;&lt;/div&gt;\n&quot;;
     }
}
</pre>
</div>
<p>Save that file.</p>
<h4>One Setting you can adjust</h4>
<p>There is one number you may want to adjust in the code for functions.php above. On the very first line you will see <code>$range = 2</code> This is the number of pages linked to either side of the current page. If there are just 5 pages you will see just 5 links that is the range 2 below, 1 for current and 2 above.<br />
<a href="http://gasolicious.com/wp-content/uploads/2012/10/3-of-5.jpg"><img class="size-full wp-image-2047 alignnone" title="3-of-5" src="http://gasolicious.com/wp-content/uploads/2012/10/3-of-5.jpg" alt="" width="212" height="30" /></a><br />
You coud raise range to 3 and you would see 7 numbered page links at a time. Once the number of result pages exceeds the range times 2 plus 1 the next and previous buttons will appear as required like this<br />
<a href="http://gasolicious.com/wp-content/uploads/2012/10/prev-next.jpg"><img class="alignleft size-full wp-image-2048" title="prev-next" src="http://gasolicious.com/wp-content/uploads/2012/10/prev-next.jpg" alt="" width="433" height="26" /></a></p>
<h4>Second PHP file</h4>
<p>Make sure you have a copy of the original search.php file in case you have problems.<br />
Now open search.php, delete everything and paste in this code. You could also just <a href="http://gasolicious.com/wp-content/uploads/2012/10/search.zip" title="download modified for pagination search.php file for Storefront themes Gridport theme" target="_blank">download the file here</a>, unzip and upload to replace the search.php on your site. What I have done is remove the second loop for blog posts. It is not really possible to have pagination if you have 2 loops, which pages would it be based on? As I mentioned you may be able to adapt this so one loop returned all mixed together. Once reduced to one loop I just call the pagination function I added to the functions.php file above, see line 46.</p>
<div class="myCode">
<pre class="brush: php; first-line: 1; highlight: [46]; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;?php
$image_width  = get_option( 'product_image_width' );
$image_height  = get_option( 'product_image_height' );
?&gt;

&lt;div class=&quot;leftcontent titlepop&quot;&gt;
	
			&lt;h2&gt;&lt;?php _e( 'Search Results', 'storefront' ); ?&gt;&lt;/h2&gt;			
			
			&lt;?php 
			global $query_string; // grab the search query
	        query_posts($query_string . &quot;&amp;post_type=wpsc-product&quot;);
			
	        ?&gt;
			&lt;?php if (have_posts()) : ?&gt;
						
			&lt;h3 class=&quot;twotone-bottom&quot; style=&quot;padding: 0px 0 10px 0; margin: 0 0 15px 0;font-size:15px;&quot;&gt;&lt;?php _e( 'Your search for ', 'storefront' ); ?&gt;&quot;&lt;?php echo wp_specialchars($s); ?&gt;&quot; &lt;?php _e( 'returned the following Products:', 'storefront' ); ?&gt;&lt;/h3&gt;
			
			&lt;?php while (have_posts()) : the_post(); ?&gt;		    
		       
		       &lt;?php if(wpsc_show_thumbnails()) <img src='http://gasolicious.com/wp-includes/images/smilies/icon_confused.gif' alt=':?' class='wp-smiley' /> &gt;
					&lt;div class=&quot;srch_product_image&quot; style=&quot;width:75px&quot;&gt;
						&lt;?php if(wpsc_the_product_thumbnail()) : ?&gt;						

							&lt;a href=&quot;&lt;?php echo wpsc_the_product_permalink(); ?&gt;&quot; title=&quot;&lt;?php echo wpsc_the_product_title(); ?&gt; - &lt;?php echo wpsc_the_product_price(); ?&gt;&quot; style=&quot;cursor:pointer;&quot;&gt;&lt;img class=&quot;product_image shadow&quot; id=&quot;product_image_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot; alt=&quot;&lt;?php echo wpsc_the_product_title(); ?&gt;&quot; width=&quot;75px&quot; height=&quot;75px&quot; src=&quot;&lt;?php echo wpsc_the_product_thumbnail(); ?&gt;&quot;/&gt;&lt;/a&gt;			
							
						&lt;?php else: ?&gt;
								&lt;a href=&quot;&lt;?php echo wpsc_the_product_permalink(); ?&gt;&quot;&gt;
								&lt;img class=&quot;no-image&quot; id=&quot;product_image_&lt;?php echo wpsc_the_product_id(); ?&gt;&quot; alt=&quot;No Image&quot; title=&quot;&lt;?php echo wpsc_the_product_title(); ?&gt;&quot; src=&quot;&lt;?php echo WPSC_CORE_THEME_URL; ?&gt;wpsc-images/noimage.png&quot; width=&quot;75px&quot; height=&quot;75px&quot; /&gt;	
								&lt;/a&gt;
						&lt;?php endif; ?&gt;

					&lt;/div&gt;&lt;!--close imagecol--&gt;
				&lt;?php endif; ?&gt;
                &lt;div class=&quot;srch_product_title&quot;&gt;
                    
                      &lt;h3 style=&quot;float:left;font-size:13px;&quot;&gt;&lt;a href=&quot;&lt;?php echo wpsc_the_product_permalink(); ?&gt;&quot; title=&quot;&lt;?php echo wpsc_the_product_title(); ?&gt; - &lt;?php echo wpsc_the_product_price(); ?&gt;&quot; style=&quot;cursor:pointer;&quot;&gt;&lt;?php echo wpsc_the_product_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
                    
                &lt;/div&gt;&lt;!-- close title --&gt;
		        
                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;   
		    
		    &lt;?php endwhile; 
			storefront_pagination();
			else: ?&gt;
	
	    &lt;div class=&quot;entry&quot;&gt;
	
	            &lt;h6&gt;&lt;?php _e( 'Sorry, no products matched your criteria.', 'storefront' ); ?&gt;&lt;/h6&gt;
	
	    &lt;/div&gt;
	
		&lt;?php endif; ?&gt;			
	    
	    &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;

&lt;/div&gt;&lt;!-- end of left content --&gt;

&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;

&lt;?php get_footer(); ?&gt;
</pre>
</div>
<h4>The CSS to make it pretty</h4>
<p>Now it should work. You need to make it look good. Add this code to the Storefront Options Panel/Style Tab Custom CSS box or your custom.css file if using one.</h4>
<div class="myCode">
<pre class="brush: css; title: ; notranslate">
.pagination-search {
clear:both;
padding:20px 0;
position:relative;
font-size:11px;
line-height:13px;
}

.pagination-search span, .pagination-search a {
display:block;
float:left;
margin: 2px 2px 2px 0;
padding:6px 9px 5px 9px;
text-decoration:none;
width:auto;
color:#fff;
background: #555;
}

.pagination-search a:hover{
color:#fff;
background: #3279BB;
}

.pagination-search .current{
padding:6px 9px 5px 9px;
background: #3279BB;
color:#fff;
}
</pre>
</div>
<div class="note-panel">
<h4>Tools:</h4>
<p>You may edit your PHP outside WordPress and upload it to your server. You must use an appropriate code editor NOT microsoft word or anything like that which adds a lot of invisible formatting and will be a disaster.<br />
If you do not have one, 2 excellent free ones are&#8230;<br />
TextWrangler for Mac, http://www.barebones.com/products/textwrangler/<br />
Notepad++ for the PC http://notepad-plus-plus.org/</p>
<p>If you want to go all out Aptana, this is a serious and powerful code editor for both mac and pc. It is free. Has handy code hinting, that is as you type it shows you what the options are for the setting you are working with. It could be overkill, or great. http://aptana.com/</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/gridport-theme-search-pagination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug in WP e-Commerce UPS Ground does not display</title>
		<link>http://gasolicious.com/wpec-ups-ground-not-displayed/</link>
		<comments>http://gasolicious.com/wpec-ups-ground-not-displayed/#comments</comments>
		<pubDate>Tue, 23 Oct 2012 01:22:17 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=2028</guid>
		<description><![CDATA[Very short post today. An annoying issue in WPEC that is very easily fixed. If you are using UPS as your shipping method and Ground shipping does not display. Possibly applies to other methods too, I am not sure. So if you have a shipping method set but it just refuses to show this could [...]]]></description>
				<content:encoded><![CDATA[<p>Very short post today. An annoying issue in WPEC that is very easily fixed. If you are using UPS as your shipping method and Ground shipping does not display. Possibly applies to other methods too, I am not sure. So if you have a shipping method set but it just refuses to show this could be the answer.<br />
I found the answer on getShopped forums, thanks to user EleGenius.</p>
<h4>Solution:</h4>
<p>Change the ‘Packaging’ option to ‘Your Packaging’, this option seems to be the only option that will bring back the Ground Shipping Option.<br />
If you can not use &#8220;Your packaging&#8221; then you will need to try try getshopped forums, at that point it is beyond my knowledge.</p>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/wpec-ups-ground-not-displayed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP e-Commerce no images in &#8220;People who bought this also bought&#8221;</title>
		<link>http://gasolicious.com/commerce-images-people-also-bought/</link>
		<comments>http://gasolicious.com/commerce-images-people-also-bought/#comments</comments>
		<pubDate>Sat, 06 Oct 2012 19:32:40 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=2025</guid>
		<description><![CDATA[This is a WP e-Commerce bug When &#8220;Display Cross Sales&#8221; is activated on Settings/Store/Marketing tab the &#8220;People who bought this item also bought&#8221; section displays on the single product page. The display does not include the product thumbnail as the location for the thumbnail generated by the plugin is incorrect. As of version 3.8.8.5 this [...]]]></description>
				<content:encoded><![CDATA[<h4>This is a WP e-Commerce bug</h4>
<p>When &#8220;Display Cross Sales&#8221; is activated on Settings/Store/Marketing tab the &#8220;People who bought this item also bought&#8221; section displays on the single product page. The display does not include the product thumbnail as the location for the thumbnail generated by the plugin is incorrect. As of version 3.8.8.5 this bug still exists. <a href="http://code.google.com/p/wp-e-commerce/issues/attachmentText?id=951&#038;aid=9510000000&#038;name=also_brought.diff&#038;token=Qz73CBjRqx0hLgdpgT-xyJi_5xw%3A1332149476475" title="code diff for WP e-Commerce display.functions.php" target="_blank">This code diff on code.google</a> covers the changes required to make it work. Some of these changes have been implemented in 3.8.8.5, some not. This makes it a bit confusing, and diffs are very confusing for any non developer anyway. So I poked through it carefully and made the changes. tested and have verified images are working.</p>
<h4>The PHP code fix</h4>
<p>You can download the <a href="http://gasolicious.com/help/display.functions.php.zip" title="download the fix for WP e-Commerce display.functions.php" target="_blank">working file here</a>. The file should be unzipped and uploaded to the wp-content/plugins/wp-e-commerce/wpsc-includes folder to replace the existing display.functions.php file.</p>
<h4>CSS layout fix</h4>
<p>You will have a vertical stack of images with product title and price aligned left and together once you do the change above. Add this CSS to fix the layout.</p>
<div class ="myCode">
<pre class="brush: css; title: ; notranslate">
/*align images, set text centering*/
.wpsc_also_bought_item {
     float: left;
     margin-right: 20px;
     text-align: center;
}
/* set price width so text centers*/
.wpsc_also_bought_item span.pricedisplay {
     width: 100%;
}
/* set product title width so text centers*/
.wpsc_also_bought_item a.wpsc_product_name {
     float: left;
     width: 100%;
}
</pre>
</div>
<div  class ="note-panel">
<h4>Custom CSS:</h4>
<p>This code belongs in your Custom CSS file. Don&#8217;t have a custom.css?<br />
If using a Storefront theme you can also just paste this code in the &#8220;Custom CSS&#8221; box in the Storefront options panel on the Style tab.</p>
<h4>Tools:</h4>
<p>You may also edit custom.css outside WordPress and upload it to your server. You must use an appropriate code editor NOT microsoft word or anything like that which adds a lot of invisible formatting and will be a disaster.<br />
If you do not have one, 2 excellent free ones are&#8230;<br />
TextWrangler for Mac, http://www.barebones.com/products/textwrangler/<br />
Notepad++ for the PC http://notepad-plus-plus.org/</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/commerce-images-people-also-bought/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Usernames and Passwords</title>
		<link>http://gasolicious.com/wordpress-usernames-passwords/</link>
		<comments>http://gasolicious.com/wordpress-usernames-passwords/#comments</comments>
		<pubDate>Wed, 03 Oct 2012 16:18:39 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=2005</guid>
		<description><![CDATA[Hackers love the user name &#8216;admin&#8217;. half the hacking problem solved for free. Hacking happens unfortunately often. Doing support I am asked to login to at least 4 or 5 peoples sites every day. At least 50% use admin as their username! Stop people! Make a simple change to protect yourself. There is much more to [...]]]></description>
				<content:encoded><![CDATA[<p>Hackers love the user name &#8216;admin&#8217;. half the hacking problem solved for free. Hacking happens unfortunately often. Doing support I am asked to login to at least 4 or 5 peoples sites every day. At least 50% use admin as their username! Stop people! Make a simple change to protect yourself. There is much more to security but not leaving a key under the flowerpot is a good start. So read the notes on user names and passwords and then follow the steps to remove that hacker invitation.</p>
<h4>Valid WordPres User name characters:</h4>
<div class="note-panel">
<p>
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br />
abcdefghijklmnopqrstuvwxyz<br />
0123456789<br />
_ (underscore)<br />
(space)<br />
. (period)<br />
- (hyphen)<br />
@ (at sign)
</p>
</div>
<p></p>
<h4>Passwords</h4>
<p>You can also use passphrases – whole sentences, such as quotes or favorite song lyrics. Passphrases are harder to guess yet easier to remember. They take longer to type, but are considered more secure, especially if you pepper them with some random numbers and special characters. This is enormously difficult to crack by brute force but would be easy to remember..<br />
Wheniwa$$mallihadadognamedFritzilovedhim<br />
Fore a deeper explanation <a href="http://xkcd.com/936/" title="password strength explained" target="_blank">see this cartoon</a> </p>
<p>However, even if you manage to think of a good password, it will only be as secure as the number of sites you use it on. If you always use the same password on every site you sign up for, the chances of your password getting compromised are greatly increased.</p>
<p>Instead of trying to keep track of dozens of passwords in your head or in unsecured text documents on your desktop, use password management software. They will lock all your information down behind one single password. If you only have to remember one password, you can make it as random and as hard to guess as you want.</p>
<p>These are some password managers. I personally think 1Password is worth the money:</p>
<p><a href="http://keepass.info/" title="Link to KeePass password protection software" target="_blank">Keepass</a> – Open Source, free to download and use. Available for Windows, Mac and Linux.<br />
<a href="https://lastpass.com/" title="Link to LastPass password protection software" target="_blank">LastPass</a> – Free service with premium option. Available for all major OSs, browsers and mobile devices.<br />
<a href="https://agilebits.com/onepassword" title="link to 1 password password protection software" target="_blank">1Password</a> – Paid download. Available for Windows, Mac and iOS, with support for all major browsers.<br />
Your data – your responsibility.</p>
<h4>Remove the default Admin user</h4>
<p>Always when you start a WordPress site remove the &#8216;admin&#8217; user, BUT follow these steps so that you do not lose all of your data. It is easy but the urge to quickly click without reading can skip a step and everything is gone. Bad design on WordPress part I think.</p>
<ol>
<li>Make a new user first with a hard name to guess, not your name, not the site name, not even real words. The user name can only have certain characters. See info panel below</li>
<li>Make the password really difficult too. You can use a password generator http://freepasswordgenerator.com/ or just tricks like substituting $ for S,* for i and ^ for v making a word you can remember.</li>
<li>Make that User have full Administrator privileges.</li>
<li>Logout and log back in as as that user and make sure it works and you have full Administrator privileges. Don&#8217;t skip this step</li>
<li>Before you delete read all of this step, do not click too fast!!<br />
Click delete under the &#8216;admin&#8217; user name. A delete users page opens <strong>do not forget to check &#8220;attribute all posts and links to&#8221;</strong> and choose your new user. If you do not you will lose everything!!!!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/wordpress-usernames-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix for WP e-Commerce bug, pagination links in tag and search result pages don&#8217;t work.</title>
		<link>http://gasolicious.com/commerce-pagination-links-search/</link>
		<comments>http://gasolicious.com/commerce-pagination-links-search/#comments</comments>
		<pubDate>Sat, 25 Aug 2012 10:48:43 +0000</pubDate>
		<dc:creator>mgason</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://gasolicious.com/?p=1991</guid>
		<description><![CDATA[The question from a Storefront user Recently, the Product Cloud Tag Widget was activated. When one of the tags is click on, the first page loads correctly. However, when the &#8216;next&#8217;, &#8216;last&#8217; or a page number is clicked in the pagination, the displayed items changed from tagged to all products (product-page). Answer This is a [...]]]></description>
				<content:encoded><![CDATA[<h4>The question from a Storefront user</h4>
<p>Recently, the Product Cloud Tag Widget was activated. When one of the tags is click on, the first page loads correctly. However, when the &#8216;next&#8217;, &#8216;last&#8217; or a page number is clicked in the pagination, the displayed items changed from tagged to all products (product-page).</p>
<h4>Answer</h4>
<p>This is a bug. A pretty bad one really, seems to have been around a long time too. It can be fixed with a small PHP edit in the WP e-Commerce plugin. If you have never edited PHP see the notes and tools at the end of this post. This post is written for the 3.8.8.5 version of WP e-Commerce. This may be fixed one day. If not I imagine the code will be much the same. The line numbers may change, so I will post a good chunk of code to help you identify the right piece to modify. Credit to Dean at <a href="http://www.chainsawdr.com/" title="Link to original article on which this fix is based" target="_blank">ChainsawDR</a> for most of this fix. I have added some code so that you do not need to hardcode the URL for your site and changed the search location to the more standard WordPress ?s=. As noted in the code you may need to change that if you have special search page or a plugin that uses a different URL. You can check this easily by doing a search and checking the URL in the browser.</p>
<h4>Code</h4>
<p>Open wp-content/plugins/wp-e-commerce/wpsc-includes/product-template.php<br />
Find the highlighted code which should be at line 116 if you have WP e-Commerce 3.8.8.5. Do not be fooled by the identical line at 105 as I was the first time I did this.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 102; highlight: [116,117,118,119,120,121,122,123]; title: ; notranslate">
	//if there is no pagination
	if(!get_option('permalink_structure')) {
		$category = '?';
		if(isset($wp_query-&gt;query_vars['wpsc_product_category']))
			$category = '?wpsc_product_category='.$wp_query-&gt;query_vars['wpsc_product_category'];
		if(isset($wp_query-&gt;query_vars['wpsc_product_category']) &amp;&amp; is_string($wp_query-&gt;query_vars['wpsc_product_category'])){

			$page_link = get_option('blogurl').$category.'&amp;amp;paged';
		}else{
			$page_link = get_option('product_list_url').$category.'&amp;amp;paged';
		}

		$separator = '=';
	}else{
		if ( isset( $wp_query-&gt;query_vars['wpsc_product_category'] ) ) {
			$category_id = get_term_by( 'slug', $wp_query-&gt;query_vars['wpsc_product_category'], 'wpsc_product_category' );
			$page_link = trailingslashit( get_term_link( $category_id, 'wpsc_product_category' ) );
		} else {
			$page_link = trailingslashit( get_option( 'product_list_url' ) );
		}
		$separator = 'page/';
	}

	// If there's only one page, return now and don't bother
	if($totalpages == 1)
		return;
	// Pagination Prefix
	$output = __('Pages: ','wpsc');

</pre>
</div>
<p></p>
<p>Replace the highlighted lines with all of the code below.<br />
If you do need to change the search you just need to change the part that comes after your sites URL in the highlighted line in the new code, which is also commented. In my case the URL of a search result page for fruit was http://mysite.com/?s=fruit. So I added ?s= in that line. You put whatever comes between the URL .com/ and the search term in place of ?s= below.</p>
<div class ="myCode">
<pre class="brush: php; first-line: 116; highlight: [121]; title: ; notranslate">
if(isset($wp_query-&gt;query_vars['wpsc_product_category']))
$page_link = trailingslashit(get_option('product_list_url')).$wp_query-&gt;query_vars['wpsc_product_category'].'/';
elseif(isset($wp_query-&gt;query_vars['product_tag']))
$page_link = trailingslashit(get_bloginfo('url')).'tagged/'.$wp_query-&gt;query_vars['product_tag'].'/';
else //if its not a product category and its not a product tag then presuming it must be a product search, if this messes up for anything else then add in another if statement for that scenario
$page_link = trailingslashit(get_bloginfo('url')).'?s='.($_GET[&quot;product_search&quot;]).'&amp;'; // your search URL maybe different, change accordingly

if(isset($wp_query-&gt;query_vars['wpsc_product_category']))
$separator = 'page/';
elseif(isset($wp_query-&gt;query_vars['product_tag']))
$separator = 'page/';
else //if its not a product category and its not a product tag then presuming it must be a product search, if this messes up for anything else then add in another if statement for that scenario
$separator = 'page=';
}
</pre>
</div>
<p></p>
<div  class ="note-panel">
<h4>Tools:</h4>
<p>You may edit your PHP outside WordPress and upload it to your server. You must use an appropriate code editor NOT microsoft word or anything like that which adds a lot of invisible formatting and will be a disaster.<br />
If you do not have one, 2 excellent free ones are&#8230;<br />
TextWrangler for Mac, http://www.barebones.com/products/textwrangler/<br />
Notepad++ for the PC http://notepad-plus-plus.org/</p>
<p>If you want to go all out Aptana, this is a serious and powerful code editor for both mac and pc. It is free. Has handy code hinting, that is as you type it shows you what the options are for the setting you are working with. It could be overkill, or great. http://aptana.com/
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://gasolicious.com/commerce-pagination-links-search/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
