Last active
October 10, 2017 11:51
-
-
Save svebal/32f08ca07b737a76e224e107466d983f to your computer and use it in GitHub Desktop.
Revisions
-
svebal revised this gist
Oct 10, 2017 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ <?php /** * to body of one page * https://developer.wordpress.org/reference/functions/body_class/ **/ function svebal_custom_body_class_v1( $classes ) { if ( is_page( 'page-1' ) ) { @@ -23,8 +23,8 @@ function svebal_custom_body_class_v2( $classes ) { add_filter( 'body_class', 'svebal_custom_body_class_v2' ); /** * to a post * https://developer.wordpress.org/reference/functions/post_class/ **/ function svebal_custom_post_class( $classes ) { if( is_page( 'page-1' ) ) { -
svebal revised this gist
Oct 10, 2017 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,8 @@ <?php /** to body of one page https://developer.wordpress.org/reference/functions/body_class/ **/ function svebal_custom_body_class_v1( $classes ) { if ( is_page( 'page-1' ) ) { $classes[] = 'own-class'; @@ -19,7 +22,10 @@ function svebal_custom_body_class_v2( $classes ) { } add_filter( 'body_class', 'svebal_custom_body_class_v2' ); /** to a post https://developer.wordpress.org/reference/functions/post_class/ **/ function svebal_custom_post_class( $classes ) { if( is_page( 'page-1' ) ) { $classes[] = 'own-class'; -
svebal revised this gist
Oct 10, 2017 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,26 +5,26 @@ function svebal_custom_body_class_v1( $classes ) { $classes[] = 'own-class'; } return $classes; } add_filter( 'body_class', 'svebal_custom_body_class_v1' ); /** to body of more pages **/ function svebal_custom_body_class_v2( $classes ) { if( is_page( array( 'page-1', 'page-2', 'page-2' ) ) ) { $classes[] = 'own-class'; } return $classes; } add_filter( 'body_class', 'svebal_custom_body_class_v2' ); /** to a post **/ function svebal_custom_post_class( $classes ) { if( is_page( 'page-1' ) ) { $classes[] = 'own-class'; } return $classes; } add_filter( 'post_class', 'svebal_custom_post_class' ); ?> -
svebal revised this gist
Oct 10, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ <?php /** to body of one page **/ function svebal_custom_body_class_v1( $classes ) { if ( is_page( 'page-1' ) ) { $classes[] = 'own-class'; } return $classes; } -
svebal revised this gist
Oct 10, 2017 . No changes.There are no files selected for viewing
-
svebal revised this gist
Oct 10, 2017 . No changes.There are no files selected for viewing
-
svebal revised this gist
Oct 10, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function svebal_custom_body_class_v2( $classes ) { return $classes; } add_filter( 'body_class', 'svebal_custom_body_class_v2' ); /** to a post **/ function svebal_custom_post_class( $classes ) { -
svebal created this gist
Oct 10, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ <?php /** to body of one page **/ function svebal_custom_body_class_v1( $classes ) { if ( is_page( 'page-1' ) ) { $classes[] = 'own-class'; } return $classes; } add_filter( 'body_class', 'svebal_custom_body_class_v1' ); /** to body of more pages **/ function svebal_custom_body_class_v2( $classes ) { if( is_page( array( 'page-1', 'page-2', 'page-2' ) ) ) { $classes[] = 'own-class'; } return $classes; } add_filter( 'body_class', 'svebal_custom_body_class_v1' ); /** to a post **/ function svebal_custom_post_class( $classes ) { if( is_page( 'page-1' ) ) { $classes[] = 'own-class'; } return $classes; } add_filter( 'post_class', 'svebal_custom_post_class' ); ?>