Astra_Ext_Blog_Pro_Markup::astra_ext_blog_pro_body_classes( array $classes )
Add Body Classes
Description
Parameters
- $classes
-
(array) (Required) Body Class Array.
Return
(array)
Source
File: addons/blog-pro/classes/class-astra-ext-blog-pro-markup.php
public function astra_ext_blog_pro_body_classes( $classes ) { if ( is_archive() || is_home() || is_search() ) { global $wp_query; $blog_layout = astra_get_option( 'blog-layout' ); $blog_masonry = astra_get_option( 'blog-masonry' ); $blog_grid = astra_get_option( 'blog-grid' ); $blog_grid_layout = astra_get_option( 'blog-grid-layout' ); $blog_pagination = astra_get_option( 'blog-pagination' ); // Masonry layout for blog. if ( $blog_masonry && $wp_query->posts ) { $classes[] = 'blog-masonry'; } // Blog layout. if ( 'blog-layout-1' == $blog_layout ) { $classes[] = 'ast-blog-grid-' . esc_attr( $blog_grid ); } else { $classes[] = 'ast-blog-grid-' . esc_attr( $blog_grid_layout ); } // Blog layout. $classes[] = 'ast-' . esc_attr( $blog_layout ); if ( 'infinite' === $blog_pagination ) { // Pagination type. $classes[] = 'ast-blog-pagination-type-infinite'; } if ( 'number' === $blog_pagination ) { $blog_pagination_style = astra_get_option( 'blog-pagination-style' ); $classes[] = 'ast-pagination-' . esc_attr( $blog_pagination_style ); } } return $classes; }
Expand full source code Collapse full source code View on Trac