Tuesday, September 16, 2014

Displaying different header content in WordPress depending on the Wishlist Member level

   
FavoriteLoadingAdd as a favorite post

This video shows you how to change the wordpress header content depending on the members Wishlist Member level. It’s a very cool way to make the site more appealing to your higher level members.
Running Time: 4:53


The Camtasia Studio video content presented here requires a more recent version of the Adobe Flash Player. If you are using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.



Code for function.php

function user_has_access_to($product_name) {

      global $current_user, $user_data, $wpdb;
    get_currentuserinfo();

      $user_id = $current_user->ID;
   if ($user_id ==” ) {
        return false;
     }
if(in_array($product_name,WLMAPI::GetUserLevels($user_id)))
{
$return = true;
}
          return $return;
}

Code for header.php 

<?php
 if ( user_has_access_to(‘Silver’) ) {
?>
       <p>Silver Member Welcome</p>
<?php
} else {
?>
       <p><?php bloginfo(‘description’); ?></p>
<?php
}
?>

 

Quesions or comments on this hack? Post them on the members forum .

[/am4guest]

Speak Your Mind

Please use the comments area for pointing out mistakes on the article/videos, use the forum link for questions..

You must be logged in Premium Member to post or read comments.