Posts

How to recreate woocommerce pages

When you activate woocommerce plugin, a message box pops up at the top of the wordpress dashboard, inviting you to let the plugin automatically create specific woocommerce pages : shopping cart, order page, user page, etc... You can also remove the notice if you want to create the pages yourself. But if you change your mind and would like woocommerce to create the pages there is a tip that is documented on a stackoverflow conversation, it's very simple :

What ended up working for me was adding "&install_woocommerce_pages=true" to the Settings page URL.

 

Complex layout operations with wordpress

Building enterprise web sites from various graphic models involves two different level of customisation within the wordpress framework.

Page and post templates in wordpress

Themes are pieces of code aggregating various page types : archive pages, single post display, single page display. Most commonly all models of a theme share the same header and footer, and depending on specific coding operations, the same menu from the wordpress menu system. The theming system allows a lot customization options, including the possibility to define page templates for letting editors choose, for example, between full size page and 2 column page with widget enabled margin.

In native wordpress, this templating modification works only for pages. if you need to do this for posts, you need to install a specific extension "Custom Post Template" that will let you define specific post template, the same way you do for pages, by writing specific php template with instructions in the header comments.

Multi theming your site

Considering possibilities described above, multiple theming raises a lot of issues. The plugin JonRadio multiple theme comes with many configuration options to define specific theme for pages or sections. It has a big drawback though : it does not integrate theme options for the second theme, like widgets or menu, or other options.

5 Responsive Sliders plugins for WordPress with Touch Swipe Gestures

5 Responsive Sliders plugins for WordPress with Touch Swipe Gestures

An Image is capable of conveying thousands of feeling one the first look. The Right image gallery would definitely be the multiplying factor for your business clients as well as customer satisfaction. Definitely it is the best medium to showcase your complete range of products and services to your potential clients. With the advent of the WordPress more and more web businesses are making their way to use this most effective platform for their business.

Also similarly with the increase in the mobile devices such as iPhone, iPad and Android it is quite difficult for the designers to make their content to be compatible with these devices. Below are mentioned some of the leading plugins for the WordPress having the touch swipe feature which will completely change the way you do your business.

All these plugins are the responsive sliders and will integrate with your business to perfection.    

SwipeJS

The plugin basically gives you the best responsive taste without any trouble.  Many developers are using this open source plugin and certainly it has the thumb swipe feature for the mobile devices. Among the features of it are that it is responsive as well as it is IE7+ compatible. Along with that it supports all the Galley API’s such as previous, next, slide number and many more. It is best for callbacks and External API customization.

  Kenburner Slider WordPress Plugin

Kenburner

It is the dynamic combination of the text animation, Ken burner effects, versatile sliders and responsive features. You can really customize this slider as per your needs with a little CSS and HTML changes. It can be used with the thumb swipe gestures. It is easy to install and can be easily resized in terms of thumbs and images.

 Photoswipe

PhotoSwipeThis plugin for the WordPress is the most widely used plugin and no doubt it is mainly for the mobile devices. It is a HTML/ CSS/Java script based image gallery which is full responsive and touch compatible with the mobile devices. The plugin is basically open source and have many API’s which make it the famous option among many users. It is best optimized for the touch devices.

  Royalslider

The plugin is certainly easy to use and is one of the best responsive types of plugin. Some of the features of it are content slider, animated captions, responsive layout, touch support and many other features. For the navigation purposes you can use the thumbnails, tabs or bullets. You can use it banner rotator, gallery, content slider, video gallery, HTML content, slide show and various other types of purposes.

  Galleria –Responsive Java Script Image Gallery

It is basically the Java Script framework that simplifies the process of the creation of the beautiful images and galleries for web applications. The plugin is best for the responsive panel and it is free without any type of restrictions. Also it is touch swipe friendly and a comprehensive documentation is available. There is the option for the multiple themes along with the one core theme.

The above plugins are best responsive for the WordPress. All of them have the touch swipe optimization and can be customized for every type of device by the user as per the requirements.

Author Bio

Claudia has written on a number of articles on the  Microsoft SQL Server Training highlighting its importance in the business and IT world. The author tries to make the reader accustomed to every dimension of this task follow me on Twitter, Facebook & Google+.

woocommerce hack : free shipping incentive sales

When configuring woocommerce for wordpress shopping rates, you can opt for a combination of flat rate and free shipping with  minimum amount. by default woocommerce shopping cart will not behave perfectly. First hack will let the shopping cart shipping method selection update automatically when minimum order for free shipping is reached. Second hack will display an incentive message wehn minimum amount for free shipping is not reached. Everything is coded via filters and actions, and will work with woocommerce 2.0 and above

first hack : update shipping display choice when free shipping  minimum amount is reached

/**   from  https://github.com/woothemes/woocommerce/issues/1499
 *  Hide Standard Shipping option when free shipping is available
 */
add_filter( 'woocommerce_available_shipping_methods', 'hide_standard_shipping_when_free_is_available' , 10, 1 );
function hide_standard_shipping_when_free_is_available( $available_methods ) {

    if( isset( $available_methods['free_shipping'] ) AND isset( $available_methods['flat_rate'] ) ) {

        // remove standard shipping option
        unset( $available_methods['flat_rate'] );
    }

    return $available_methods;
}

second hack : display incentive message when minimum amount is not reached, including display of minimum amount and remaining amount to add to shopping cart. Very efficient ! 

 add_action( 'woocommerce_cart_totals_after_shipping', 'webmasterbulletin_sales_incentive'  );
       function  webmasterbulletin_sales_incentive()
       {
            global $woocommerce;
            $all_methods = $woocommerce->shipping->load_shipping_methods();
           
          $available_methods = $woocommerce->shipping->get_available_shipping_methods(); 
           if (isset( $all_methods['free_shipping'] )) 
           if (isset( $available_methods['flat_rate'] ))
              echo "<tr><td colspan='2'><div class='sales_incentive'><b> 
              buy more products  :</b><br>
               only " .  woocommerce_price($all_methods['free_shipping']->settings['min_amount']-  $woocommerce->cart->cart_contents_total   ) . "  more and get <br>
              <b>free shipping starting at  
              " .    woocommerce_price($all_methods['free_shipping']->settings['min_amount']   )    . " </b>
               </div></td></tr>";
       }

 

wordpress : protect file download to registered users only

In this article we will explore a set of code hooks into the worpdress customization framework. The aim of this technique si to hide pdf documents from search engines and non connected users,  and to present them with a custom  login page if not connected, that would redirect directly to the file download after identification (login) via this custom login page.

  • STEP1:  block pages for non registered users
    • to block a page from non registered users, page editor must set a custom field "block" set to 1.
  • present non registered users with form on protected pages
    • we filter the content (the_content)   and return a login form if user is not connected for pages. the login form is included in a specific file po_login_form
  • create specific pdf download link for first page attached PDF, with docid as get variable
    • on your page template, use a query to find your pdf (page attachment) object, once you have that pdf object you can use it to make your url depending on the login status: 
if (is_user_logged_in()) $urlPDF=$pdf->guid; else $urlPDF="/utilisateurs/identification/?docid=" . $pdf->ID;
  • redirect to file if get variable is set
    • add the po_redirect_after_login function the init filter. This function will test the docid   get variable, find  the corresponding pdf attachment and redirect to this attachment url if found and user is logged in, otherwise does nothing and lets the_content filter do its job presenting the login form.

wordpress post / page save and see

After a few hours of searching on the internet I finally assembled the hooks and actions necessary to add a new button to the save meta box for worpdress posts and pages. What I needed was a button that saves my work on a post edit page, and redirects to view the post .  here is the code for your functions.php file or plugin, change title in both functions for your own language preference. Hey who's making the plugin ?

 

add_action('post_submitbox_misc_actions', 'save_and_see_button');
function save_and_see_button()
{
    //global $post;
    echo '<div id="send-for-correction" class="misc-pub-section"
    style="border-top-style:solid; border-top-width:1px; border-top-color:#EEEEEE; border-bottom-width:0px;">
    <input id="save-post2" class="button button-highlighted"
    type="submit" value="MAJ + voir" name="save">
        </div>';
}add_filter( 'redirect_post_location' , 'my_filter_handler'   );
function my_filter_handler( $location  )
{
    global $post;
    if (  ($_POST['save'])== "MAJ + voir" &&  preg_match("/post=([0-9]*)/", $location, $match) &&
        $post &&
        $post->ID == $match[1] &&
        (isset($_POST['publish']) || $post->post_status == 'publish') && // Publishing draft or updating published post
        $pl = get_permalink($post->ID)
    ) {
        // Always redirect to the post
        $location = $pl;
    }

     return $location;
}

Theme of the year : modernize by good layers

It's a rare occurence that I find a perfect wordpress theme that fits more than a single project : Modernize, sold by goodlayers  on themeforest, is one exceptionnal piece of code that does not just deal with front end layout : a powerful administration panel comes within the page / article administration system to help you configure complex layouts. Compatible not only with Internet Explorer (except old IE6), it also provides very efficient smartphone responsivness, and offers many more than just page management : slider integration, ajax portfolio management, testimonials, price table plus a great diversity of shortcodes that even your customer can use if they're familiar with wordpress system... Big thank you for support that answers quickly and correctly when you encounter customization issues, small drawback is the complexity of stylesheets and a few hours work to get your site up to speed by removing extra stylesheet and javascript goodies that you might not need. Good work Good Layers! 

Analytics in your dashboard plugin comparison

I've been using an old plugin that hasn't been updated in ages, and for a new customer I need to display serious analytics in my wordpress dashboard. I've tried a few but they don't work straight out of the box, ask you for you login and password, which I don't lie.

 

Thank mail chiomp guys, who are running the famous newsletter programm mailchimp, I have a serious plugin to integrate analytics in my dashboard. it only asks you permission to acccess analytics application via google permission, that you can revoke easily from your google account. 

links : 

 

http://wordpress.org/extend/plugins/analytics360/

wordpress search by attachment title

Funny enough, there many search enhancement plugins for wordpress, but It seems none of them can do what I want : return posts if one its child attachments matches the search query. It's easy enough when you think about it but the code below will save you the hour I spent looking for it on google .

<?php
 
 
 
add_filter('posts_join', 'po_search_join' );
add_filter('posts_where', 'po_search_where' );
add_filter('posts_groupby', 'po_search_groupby' );

function po_search_join( $join )
{
  global  $wpdb, $wp_query;
       
  if($wp_query->is_search  ) {
    $join .= " left JOIN {$wpdb->prefix}posts p2  ON  {$wpdb->prefix}posts.ID = p2.post_parent  "   ;
 
  }

  return $join;
}

function po_search_where( $where )
{ global  $wpdb, $wp_query;    
  if($wp_query->is_search    ) {
      $s=get_query_var('s');
    $where = $where . " or (p2.post_title LIKE '%" . addslashes_gpc($s)  . "%'
    ) ";
   }                  
 
  return $where;
}

function po_search_groupby( $groupby )
{
  global  $wpdb, $wp_query;  

  if( !$wp_query->is_search ) {     return $groupby; }

  // we need to group on post ID
  $mygroupby = "{$wpdb->posts}.ID";

  if( preg_match( "/$mygroupby/", $groupby )) {
    // grouping we need is already there
    return $groupby;
  }

  if( !strlen(trim($groupby))) {
    // groupby was empty, use ours
    return $mygroupby;
  }

  // wasn't empty, append ours
  return $groupby . ", " . $mygroupby;
}
 

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
      <?php
       /*
      Plugin Name: POLEOUEST-bxslider
       
      Description: 
      Author: erwan
      Version: 0.3
      Author URI: http://poleouest.Com/
      */
      
      function my_init() {
          if (!is_admin()) {
            wp_enqueue_script('jquery');
            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');

      s

 

    • put the appropriate javascript files in the js directory
  • the gallery post format code (loop code
                <div id="slider1"  >
    				<?php
    					$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 }?>
     </div>
                
                <script>
                var slider="";
    jQuery(document).ready(function(){                
          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();     }        
                </script>
               <?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 / How to create a page that displays custom field values

we are trying to display a list of custom field values for a specific meta key, in a page. 

  • install the plugin http://wordpress.org/extend/plugins/wp-page-widget/
  • code a new widget area to  display a specific widget in a content area of a page : 
    •    register_sidebar(array(
                      'name'=> __( 'main content', 'photography' ),
                      'id' => 'contentwidget',
                      'before_widget' => '<li id="%1$s" class="widget %2$s">',
                      'after_widget' => '</li>',
                      'before_title' => '<h2 class="widgettitle">',
                      'after_title' => '</h2>',
                  ));
    • add the sidebar where you want on your page.php template : dynamic_sidebar( 'main content' )
  • setup the wp page widget plugin to activate pages and the main content area you've just created
  • download and install the widget  http://wordpress.org/extend/plugins/get-custom-field-values/
  • create a new page and use the widget interface in your page to add the list of custom field values for your meta key
  • Demonstration here, what I need now is to link custom fields values to posts : http://erwan-foto.com/photos-bretagne
  • Note : I also  tried the http://wordpress.org/extend/plugins/custom-field-list-widget/ but for some reason it does not work with wp page widget

WordPress plugin : ken burns full screen HTML5

We like the HTML 5 css animations, and the codrops tutorial give a first insight into a bright future for webmasters, via  a technology that involves  almost only css coding / harsh coding though. Anyhow I provide here a plugin for wordpress that will perform two tasks

  • shortcode [wbKenBurnsFullScreen] : displays post images as full screen background with ken burns effect
  • shortcode [wbKenBurnsFullScreenRandom] : displays images selected as 'random' and creates the full screen background effect, taking image parent  post as title and link

For the moment, it is the random code that works best as it automatically selects 4 images from media library, which is the best count of images for the effect I provide, directly inspired from the codrops tutorial.

Technically the plugin also provides additional field for images (screenshot below from erwan-foto.com)

DOWNLOAD : [download id="10"]

 

WordPress pronamic map plugin : add MarkererCluster function

The Pronamic map plugin is the best free replacement for the mappress plugin, which I buyed and  used for professionnal work. Well Pronamic map plugin comes with mashup functions but has not yet integrated the new google Cluster function, which aggreagtes multiple markes from the same location to a single one . We  publish here an update for the buildMashup function from the site.js file, which incorporates the clustering that you can view live on my brittany photogaphy web site. you will also need to include the markercluster script in your header or javascript enqueue function.

 

		buildMashup: function(s) { 
			var element = $(s);

			var list = element.find("ul");

			var mashupInfo = $.parseJSON(element.find('input[name="pgmm-info"]').val());

			var canvas = element.find(".canvas").get(0);

			if(canvas) {
				if(mashupInfo.hideList) {
					list.hide();
				}
				
				var center = new google.maps.LatLng(mashupInfo.center.latitude, mashupInfo.center.longitude);
				if(google.loader.ClientLocation) {
					center = new google.maps.LatLng(google.loader.ClientLocation.latitude, google.loader.ClientLocation.longitude);
				}

				// Map options
				var mapOptions = $.extend({
						center: center 
					} , 
					mashupInfo.mapOptions
				);

				var map = new google.maps.Map(canvas, mapOptions);

				// Associated the Google Maps with the element so other developers can easily retrieve the Google Maps object
				element.data("google-maps", map);

				// Create one info window where the details from the posts will be displayed in
				var infoWindow = new google.maps.InfoWindow();
				
				// Create an bounds object so we can fit the map to show all posts
				var bounds = new google.maps.LatLngBounds();
                 var markers = [];  
				// Create markers for all the posts
				list.find("li").each(function() {
					var item = $(this);

					// Retrieve location information from an (hidden) input field with JSON data
					var info = $.parseJSON(item.find('input[name="pgm-info"]').val());

					var location =  new google.maps.LatLng(info.latitude, info.longitude);

					var markerOptions = $.extend({
							position: location , 
							map: map 
						} , 
						info.markerOptions
					);

					var marker = new google.maps.Marker(markerOptions);
                     markers.push(marker);
					item.data("google-maps-marker", marker);

					google.maps.event.addListener(marker, "click", function() {
						infoWindow.setContent(item.html());
						infoWindow.open(map, marker);
					});
					
					// Extends the bounds object with this location so we can fit the map to show all posts
					bounds.extend(location);
				});
                    var markerCluster = new MarkerClusterer(map, markers, { gridSize: 60,maxZoom: 8}); //poleouest
				if(mashupInfo.fitBounds) {
					map.fitBounds(bounds);
				}

				// Trigger ready event
				element.trigger("pronamic-google-maps-ready", map);
			}
		}

10 WordPress development rules

Basic wordpress development rules : how to implement good coding design

wordpress developers work in 3 areas

  • Graphic / web design : css, html, php
  • Technical / software analysis : php
  • Hardware / database  and server management : mysql / apache

10 rules to be a good wordpress developer

  • Search before you start : if you need something done, 99% chance someone has done it before. Search wordpress plugins database , search wordpress forum, search wordpress free and especially commercial themes where you find stuff that's worth the few dollars they ask for it,  and finally search google where a lot of solutions from personal blogs are indexed
  • Check the dates : if you are lucky enough to have found a piece of code, tutorial or plugin that  makes it, be careful of old stuff : wordpress evolves fast and some solutions to an old problem might have been solved by subsequent releases, or have become inefficient because of new features within wordpress and its codebase. don't allow stuff older than 2 years to waste your time.
  • Learn the codex : If you really need to code, don't go without learning basic possibilities that wordpress gives you : custom post types, taxonomies, template system are essential concepts to master, and without coding much accomplish a lot
  • Think simple : a lot of layout problems can easily be fixed by manipulating images or style sheets. Before you look into the theme or plugin folder, think about graphic design first and then code to code.
  • Think generic : if you do it once, why not do it for good ? take 10 minutes to expand your problem to more general solutions, and always think of the possibility of releasing your code to the world via your blog of via the wordpress plugin repository. The main idea behind this is that out there your creation will have a life of its own, will be reviewed by thousand of interested engineers and will benefit of a few enhancements from the minority of users that behave like you did.
  • Get close : if someone has done something very near to what you need, use it and enhance it. Exemple : we needed worpdress widget to link a specific url on the widget title, we enhanced some coding done by some guy and were 100% satisfied
  • Pick your framework : WordPress is particularly famous for the amount of thrid party solutions distributed for a small fee. Theme framework are basically advanced layouts with a lot of options  that require some learning curve before you get to master them, not to mention wordpress core. The ideal solution for learning a framework is to find one layout that fits your customer's requirements and choose it then learn via a specific project.
  • Reuse : even if some solution is not perfect, try to stick to what you know. Existing plugins that you know is better than a plugin you don't know for many reasons, including maintenance work that is a strong characteristic of wordpress plugins.
  • Folder Hierarchy : when getting deep inside the theme functions coding, use includes in a specific folder with your company name in it. When you get back to it a few months later you'll know instantly you are responsible for those parts of code. It  makes things easier to debug or evolve when you know it's yours
  • Document your code : there are two solutions for documenting what you have done. First is to do it alone on your files. Second it like we said before, go opensource, write about it, let people know what you have done, they'll thank you for it (sometimes pay) or bring new solutions on top of what you have brought. Good luck

Simple widget enhancer : css classes and title link




Style and title url inputs have been added to the widget form, example above on the text widget form




There are all sort of widget types for WORDPRESS that give web masters a lot of flexibility over the layout of sidebars, headers, footers. Among   many attributes of the register_sidebar function, the basis of zone creation in wordpress pages, are the before/after_widget and before/after_title.

While these attributes can specify specific classes and code for all widgets of a specific page area, the default widget system does not take care of specific elements within the sidebar : each widget should be allowed to be designed independently, via custom classes for instance.Further more, we like to keep the preformatted title (via before/after_title settings), but we find it necessary to be able to link that title. That's what we do below, extending the original custom classes feature to incorporate a title url link input. This code comes into an include of your functions.php theme and should work as is



function kc_widget_form_extend( $instance, $widget ) 
{ 
    if ( !isset($instance['classes']) )  $instance['classes']=null; 
    if ( !isset($instance['urlwidgettitle']) )  $instance['urlwidgettitle']=null; 
/* Set your predetermied class choices here */
 $myarray = "topleft, center, bottomright";
 
$myclasses = explode(",",$myarray);
 $row = "<p>\n";
 $row .= "\t<label for='widget-{$widget->id_base}-{$widget->number}-classes'>Style:</label>\n";
 $row .= "\t<select  name='widget-{$widget->id_base}[{$widget->number}][classes]'  id='widget-{$widget->id_base}-{$widget->number}-classes'  class='widefat'>\n";
 foreach($myclasses as $myclass) {
 $instance_selected = null; if($instance['classes']==$myclass) $instance_selected = " selected='selected'";
 $row .= "\t<option value='".$myclass."'".$instance_selected.">".$myclass."</option>\n";
 }
 $row .= "</select>\n";
 $row .="<p><label for='widget-{$widget->id_base}-{$widget->number}-urlwidgettitle'>Title url:</label>";
 $row .="<input type='text'  name='widget-{$widget->id_base}[{$widget->number}][urlwidgettitle]'  id='widget-{$widget->id_base}-{$widget->number}-urlwidgettitle' value='{$instance['urlwidgettitle']}'</p>"   ;
 echo $row;
 return $instance;
}
add_filter('widget_form_callback', 'kc_widget_form_extend', 10, 2);

function kc_widget_update( $instance, $new_instance ) {
 $instance['classes'] = $new_instance['classes'];
 $instance['urlwidgettitle'] = $new_instance['urlwidgettitle'];
 return $instance;
}
add_filter( 'widget_update_callback', 'kc_widget_update', 10, 2 );
function kc_dynamic_sidebar_params( $params ) {
 global $wp_registered_widgets;
 $widget_id    = $params[0]['widget_id'];
 $widget_obj    = $wp_registered_widgets[$widget_id];
 $widget_opt    = get_option($widget_obj['callback'][0]->option_name);
 $widget_num    = $widget_obj['params'][0]['number'];
 
 if ( isset($widget_opt[$widget_num]['classes']) && !empty($widget_opt[$widget_num]['classes']) )
 $params[0]['before_widget'] = preg_replace( '/class="/', "class=\"{$widget_opt[$widget_num]['classes']} ", $params[0]['before_widget'], 1 );
 
 if ( isset($widget_opt[$widget_num]['urlwidgettitle']) && !empty($widget_opt[$widget_num]['urlwidgettitle']) )
 {
     $params[0]['before_title']=  $params[0]['before_title'] . "<a href='" . $widget_opt[$widget_num]['urlwidgettitle'] . "'>";
     $params[0]['after_title']= "</a>" . $params[0]['after_title'] ;
 }
if (!strstr($params[0]['widget_id'],"text-"))
    {
        $params[0]['after_title']=  $params[0]['after_title'] . "<div class='textwidget'>";
      //  $params[0]['after_widget']  =qsdf";
        $params[0]['after_widget']  = "</div>" .   $params[0]['after_widget'];
    }
 return $params;
}
add_filter( 'dynamic_sidebar_params', 'kc_dynamic_sidebar_params' );



Free wordpress full screen background effect

Integrating full size images in a wordpress post is quite easy if you know how to integrate a plugin AND can use FTP.

The plugin wp-supersized does all the jquery wiork for you and all you have to do after activating the plugin is read the options page carefully to properly configure the page or post where the images background appear. If your theme style does'nt render the imazge background as expected, then you can use a page or post model  (for post model use the style replacement plugin) and rewrite the header and footers to only load the apporpriate style and js files.

http://wordpress.org/extend/plugins/wp-supersized/

demo on http://www.ruedesiam.com/info/expo-jean-noel-duchemin

How to : integrate wordpress menu into prestashop

The wordpress and prestashop integration is a big subject : prestashop is good for selling products and wordpress is good for dealing with content. One very efficient feature of wordpress is the menu builder that allows you to build unlimited hierachical menus. We submit here a technique that hooks into the wordpress update menu event to generate a static version of the modified menu, that can be then included in your prestashop theme via easy static include.

  1. create a cache directory in your wordpress theme folder
  2. add the following code to your functions.php file
      add_action("wp_update_nav_menu" , 'poleouestMakeMenu' );
      function poleouestMakeMenu($menuId)
      {
          $html=wp_nav_menu(array('menu'=>$menuId, "echo"=>false));
          $fileNAme= STYLESHEETPATH . "/cache/" . "menu" . $menuId .".html";
         
          file_put_contents($fileNAme,$html);
      }
  3. once you've tested that the menu . html file is generated, include it in your prestashop template via some hack in the prestashop core. Let us know how you do it !!