This function checks if all products belonging to a product category or custom taxonomy is out of stock.
This function uses Transients API to cache 1 hour the result for avoiding large amount of querys.
| <?php | |
| /* | |
| Plugin Name: SEO Slugs | |
| Plugin URI: http://www.vretoolbar.com/news/seo-slugs-wordpress-plugin | |
| Description: Removes common words like 'a', 'the', 'in' from post slugs to improve SEO. | |
| Version: 1.0 | |
| Author: Andrei Mikrukov | |
| Author URI: http://www.vretoolbar.com | |
| */ |
| <?php | |
| function add_intinite_scroll_callback( $options ) { | |
| $options['callback'] .= ' | |
| jQuery(this).find(".flexslider").each(function(index) { | |
| if ( jQuery(this).attr( "slider-loaded" ) === "0" ) { |
| <div class="flexslider" slider-started="0" slider-type="basico" slider-animation="slide"> | |
| <ul class="slides"> | |
| <li> | |
| <img src="slide1.jpg" /> | |
| </li> | |
| <li> | |
| <img src="slide2.jpg" /> | |
| </li> | |
| <li> | |
| <img src="slide3.jpg" /> |
| <div class="flexslider"> | |
| <ul class="slides"> | |
| <li> | |
| <img src="slide1.jpg" /> | |
| </li> | |
| <li> | |
| <img src="slide2.jpg" /> | |
| </li> | |
| <li> | |
| <img src="slide3.jpg" /> |
| <?php | |
| // Place this function into your functions.php theme file | |
| function pagination($pages = '', $range = 4) { | |
| $showitems = ($range * 2)+1; | |
| global $paged; | |
| if(empty($paged)) $paged = 1; | |
| if($pages == '') { | |
| global $wp_query; | |
| $pages = $wp_query->max_num_pages; | |
| if(!$pages) { |
| jQuery('#check-term').bind('change', function() { | |
| if(jQuery(this).is(':checked')){ | |
| jQuery("#acepta-condiciones").hide(); | |
| } | |
| else { | |
| jQuery("#acepta-condiciones").show(); | |
| } | |
| }); |
| <?php | |
| /* | |
| UPDATED: December 31, 2011. | |
| Modifications: | |
| - Truncated the longest country names, including: | |
| -- British Indian Ocean Territories (Chagos Archipelago) -> British Indian Ocean Territories | |
| -- South Georgia and the South Sandhich Islands -> South Georgia & S. Sandwich Islands |
| <select name="dia" id="dia"> | |
| <option value=""></option> | |
| <?php | |
| $i = 1; | |
| while ( $i <= 31 ) { | |
| if ( $i < 10 ) { | |
| $dia = '0' . $i; | |
| } |