From 066cc3fd257fee8dfd73d1958b88bb6d81d5401f Mon Sep 17 00:00:00 2001 From: Edward Caissie Date: Fri, 15 Jun 2012 21:48:31 -0400 Subject: [PATCH] Add jetpack class if the plugin is active --- .idea/workspace.xml | 101 ++++++++++++++++++++++---------------------- functions.php | 23 ++++++---- 2 files changed, 66 insertions(+), 58 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1bc5420..7fcf90c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,7 @@ - + @@ -25,10 +25,19 @@ - - + + - + + + + + + + + + + @@ -63,9 +72,9 @@ @@ -73,8 +82,8 @@ @@ -193,30 +202,26 @@ - - - - + - - - - - - - + - + + + + + + + + + @@ -272,7 +277,7 @@ @@ -341,26 +346,26 @@ - + - + - - + - - - + + + + + - @@ -463,11 +468,6 @@ - - - - - @@ -495,16 +495,12 @@ - - - + - - - + @@ -512,30 +508,35 @@ - + + + + + + - + - + - + - + - + - + - + diff --git a/functions.php b/functions.php index 0e103fc..858ec0e 100644 --- a/functions.php +++ b/functions.php @@ -562,14 +562,21 @@ function dmm_modified_post(){ if ( ! function_exists( 'bns_body_classes' ) ) { add_filter( 'body_class', 'dmm_add_body_classes' ); function dmm_add_body_classes( $classes ) { - /** Add child-theme- to default body classes */ - if ( is_child_theme() ) { - $classes[] = 'child-theme-' . sanitize_html_class( get_option( 'stylesheet' ) ); - } + /** Add child-theme- to default body classes */ + if ( is_child_theme() ) { + $classes[] = 'child-theme-' . sanitize_html_class( get_option( 'stylesheet' ) ); + } + + /** Add theme- to default body classes */ + $classes[] = 'theme-' . sanitize_html_class( get_option( 'template' ) ); + $classes = apply_filters( 'dmm_add_body_classes', $classes ); + + include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); + if ( is_plugin_active( 'jetpack/jetpack.php' ) ) { + $classes[]='jetpack'; + } + - /** Add theme- to default body classes */ - $classes[] = 'theme-' . sanitize_html_class( get_option( 'template' ) ); - $classes = apply_filters( 'dmm_add_body_classes', $classes ); - return $classes; + return $classes; } } \ No newline at end of file