Woocommerce Products Per Page

Interestingly Woocommerce does not seem to have a default setting for ‘products per page’. Unsurprisingly, there’s a simple workaround. Add to your functions.php Replace “28” with whatever number you want. add_filter( ‘loop_shop_per_page’, create_function( ‘$cols’, ‘return 28;’ ), 20 );

WordPress: Capturing Post Author Meta

An easy one here from your local Gainesville Web Designer: How to retreive the author information from a post in the WordPress loop. This assumes you’re in the loop, of course. $meta_field= get_the_author_meta( ‘your_meta’ );   Badda-bing badda-boom. You’re done. It really is that simple. Just use get_the_author_meta, the name of the meta source from… Continue reading WordPress: Capturing Post Author Meta

Preloading Images with Jquery

There are times when preloading images is an important step in keeping your site/page/program running smoothly. This is especially true in the era of mobile. Here’s a cute little snippet that does just that. function preload(yourarrayOfImages) { $(yourarrayOfImages).each(function(){ $(‘<img/>’)[0].src = this; }); } preload([ ‘img/image1.jpg’, ‘img/image2.jpg’, ‘img/image3.jpg’ ]);  

WP: Adding a HTML5 Search Form

A simple script from your local Gainesville Web Designer. [code scroll=”false” language=”htmml”] <form role=”search” method=”get” class=”search-form” action=”<?php echo home_url( ‘/’ ); ?>”> <label> <span class=”screen-reader-text”><?php echo _x( ‘Search for:’, ‘label’ ) ?></span> <input type=”search” class=”search-field” placeholder=”<?php echo esc_attr_x( ‘Search …’, ‘placeholder’ ) ?>” value=”<?php echo get_search_query() ?>” name=”s” title=”<?php echo esc_attr_x( ‘Search for:’, ‘label’ ) ?>” /> </label> <input type=”submit”… Continue reading WP: Adding a HTML5 Search Form

Jquery Simple Fadeout

A cute little snippet to show a simple green bar upon a successful edit. <?php if(isset($_GET[‘edit’])){ ?> <div id=’notifyy’> Edited Successfully </div>     <script type=”text/javascript”>     $( ‘#notifyy’ ).show(function(){     $(this).fadeOut(5000);     });     </script> <?php } ?> The CSS: #notifyy{width:100%;background:#2f5001;padding:4px 15px;color:#fff;} Always, Gainesville Web Design