WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Feb 08 2012

How to Add a Body Class to the WordPress Activation Page for Targeted CSS Styling

So the activation page (for a multisite network) can be a bit difficult to style for a full-width site that has a background on the body and a background on the #content-sidebar-wrap. Since this section is not part of Genesis (or any theme/framework for that matter) and is part of WordPress (thus no real hooks within the page), you need to add a body class to be able to target style.

[php]
add_action( 'activate_header' , 'wps_add_activate_class' );
/*
* Call body_class filter on activate_header action hook that only appears on wp-activate.php
* @author Travis Smith
*/
function wps_add_activate_class() {
add_filter( 'body_class' , 'wps_activate_class' );
}

/*
* Add specific CSS class by filter
* @author Travis Smith
*/
function wps_activate_class( $classes ) {

// add 'class-name' to the $classes array
$classes[] = 'activation-page';

// return the $classes array
return $classes;
}[/php]

Written by Travis Smith · Categorized: WordPress

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in