Search
 
SCRIPT & CODE EXAMPLE
 

PHP

add class to body class wordpress

add_filter( 'body_class', 'custom_class' );
function custom_class( $classes ) {
    if ( is_page_template( 'page-example.php' ) ) {
        $classes[] = 'example';
    }
    return $classes;
}
Comment

add class to body class wordpress

<body <?php body_class( 'class-name' ); ?>>
Comment

PREVIOUS NEXT
Code Example
Php :: debian php switch version 
Php :: ubuntu laravel storage permission 
Php :: symfony doctrine existing database 
Php :: $conn-query("SET NAMES utf8"); 
Php :: how to make db seeder in laravel 
Php :: word press get home page id 
Php :: php typecast to int 
Php :: format date in php 
Php :: Theme and plugin editor in wp dashboard missing 
Php :: get last month using php 
Php :: PHP File Read Modes 
Php :: laravel task scheduling command 
Php :: get absolute path php file 
Php :: store multiple session in laravel 
Php :: php remove path from string url 
Php :: php auto redirect 
Php :: magento getcollection get first 
Php :: create livewire component 
Php :: wpdb num_rows 
Php :: get 2 days before date in php 
Php :: get first name user 
Php :: laravel select count 
Php :: print only some characters of a string in php 
Php :: PHP str_starts_with — Checks if a string starts with a given substring 
Php :: laravel truncate string laravel 8 
Php :: array associativo php 
Php :: php date function get previous month 
Php :: check if the request is ajax request in laravel 
Php :: sort array php 
Php :: laravel tree 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =