• Skip to main content

Vi Wickam, Digital Marketing Expert

Loveland Colorado Online Marketing, Website Design and Ecommerce web development

  • About Vi
  • Website Creation
    • Website in a Day
    • Ecommerce Websites
  • Online Marketing
    • SEO (Search Engine Optimization)
    • Google Analytics
    • Google Adwords Management
    • Local Search Marketing
  • Get Listed
    • Frequently Asked Questions
    • Get Listed In Action
  • Blog
  • Contact
    • Request a Quote
You are here: Home / Wordpress / Add a Custom Body Class for WP Emember Logged In Users

Vi Wickam / September 1, 2014

Add a Custom Body Class for WP Emember Logged In Users

wp-ememberI am currently using wp eMember on a number of membership websites. Hopefully this post will help you tweak the look and feel of your wp eMember website

The idea here is that we want to customize the user experience for users who are logged into wp eMember.

My biggest reason for choosing it was its easy integration with wp eStore and wp Affiliate programs which are sold by the same company and can be purchased as a bundle at a discounted price.

I have done manual integration of affiliate software and shopping cart software more than once in the past and it can be a pretty big hassle. With this bundle, it really was a piece of cake.

I have been generally happy with all of the products. eStore could be more full featured; it’s really designed as a very simple shopping cart, but it works well for what it is.

And, the learning curve on configuring the membership software is a little bit steep, but it all makes sense once you get the hang of it.

This is the code snippet that you can add to your functions.php file to filter the body class hook to insert a new class called wp-logged-in to the body tag of any posts or pages when a user is logged in to wp eMember.

 //* Add custom body class to the head for emember logged in users
 add_filter( 'body_class', 'loggedin_body_class' );
 function loggedin_body_class( $classes ) {
 if(wp_emember_is_member_logged_in())
 $classes[] = 'wp-logged-in';
 return $classes;
 }

If you get in over your head, and need help, contact me, and I will be happy to help you with any piece of your wp eMember integration.

Filed Under: Wordpress Tagged With: body, custom class, filters, functions.php, hooks, wordpress, wp emember

Pages

  • About Vi
  • Big Picture Online Marketing
    • Google Adwords Management
    • Google Analytics
    • Local Search
    • SEO (Search Engine Optimization)
  • Blog
  • Chaos Wrangler
  • Choose
  • Connect for Success
  • Contact
    • Request a Quote
  • Ecommerce Websites
  • Get Listed
    • Get Listed Frequently Asked Questions
    • Get Listed In Action
    • Scan My Business
    • Schedule a Local Search Review
    • Signup for Get Listed
  • Jobs
  • Schedule
  • Website Creation
  • Website in a Day

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2022 ยท Vi Wickam is a Wizard of Ads Digital Marketing and Strategy Partner

  • About Vi
  • Website Creation
  • Online Marketing
  • Get Listed
  • Blog
  • Contact