WordPress : Combine Jquery slider and iphone touch swipe

in the process of building responsive themes, a challenge that's getting easier every day, you might encounter the need to satisfy your customer with touch reactivity : we describe here how to combine a nice and light slider plugin we donated 5$ to, bxslider, and the now famous jquery touchswipe plugin that brings touch reactivity to your web page if you look at it on your iphone, ipad, or any touch screen device . We have built a plugin and a custom code for gallery post format, specifically for wordpress default theme twentyeleven.


  • the plugin : bxslider , very easy : 
    • create the plugins/bxslider directory, and a bxslider.php file that contain
      Plugin Name: POLEOUEST-bxslider
      Author: erwan
      Version: 0.3
      Author URI: http://poleouest.Com/
      function my_init() {
          if (!is_admin()) {
            wp_enqueue_script('touchswipe', plugins_url('js/jquery.touchSwipe-1.2.5.js',__FILE__));       
            wp_enqueue_script('bsxslider', plugins_url('js/jquery.bxSlider.min.js',__FILE__));
           wp_enqueue_script('bsxslider', plugins_url('js/jquery.easing.1.3.js',__FILE__));     
      add_action('init', 'my_init');



    • put the appropriate javascript files in the js directory
  • the gallery post format code (loop code
                <div id="slider1"  >
    					$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
    					if ( $images ) {
    						$total_images = count( $images );
    						foreach ($images as $image)
                                $image_img_tag = wp_get_attachment_image( $image->ID, 'large' );
    				<div>	 <?php echo $image_img_tag; ?></div>
    				 <!-- .gallery-thumb -->
                                           <?php }?>
                var slider="";
          slider =jQuery('#slider1').bxSlider({auto:true});   
         jQuery('#slider1').swipe( {swipeLeft:swipeLeft, swipeRight:swipeRight,threshold:0} ); 
       function swipeLeft(event){slider.goToNextSlide();}            
       function swipeRight(event){slider.goToPreviousSlide();     }        
               <?php          } ?>



and there you go.


wordpress : Custom fields for taxonomies

Taxonomies are interesting in term of data management, but in the basic wordpress installation, you are allowed very few field for content management. I needed extra fields to display tag specific content on the archive page, and first I tried the Ultimate Taxonomy Manager, which allows you to define custom post type taxonomies and  taxonomy specific custom field, with major drawbacks though

  • being taxonomy specific, you cannot define a global keyword content structure for all taxonomies at once. Furthermore, you have to define taxonomy specific  custom field names, which makes generic keyword theming harder.
  • being wholy interface based, the custom field definition cannot be coded and as such is a long task

I then did a new search and found a piece of code that allows to define custom field for taxonomies, allowing same naming and content structure for all taxonomies. Everything is based on code that you include in your theme function or in a plugin, and as such can be duplicated on new websites. It also comes with major interesting features such as wysiwyg field editor, and group field repeater which allows to define unlimited amount of group of custom field. The stuff is called WordPress Taxonomies extra field and as it says it comes the easy way! You might watch for a few bugs / things to improve :

  • custom taxonomy content is stored in wordpress option table, not the best for efficiency
  • wysiwyg field works fine but does some filtering on images and paragraphs... to follow
Another plugin works fine too, does not have wywiyg option but has the advantage of using a specific table for storing taxonomy content, which seems a safer choice than using the options table : http://wordpress.org/extend/plugins/categorycustomfields/


WordPress : form plugin, price table plugin, event plugin

I've been using Gravity Forms for a while and I have to say I am completely satisfied with it, especially the form validation error message come out nice -I've spent a few hours on css), but a new price breaker is coming out : ninja forms is free in its lite version and costs only 30$. Other nice new plugins include pricing table and custom post type event. Source : smashing magazine

Promising Theme frameworks