astra_get_content_layout()
Return current content layout.
Description
Return
(mixed) content layout.
Source
File: inc/extras.php
function astra_get_content_layout() { if ( is_singular() ) { // If post meta value is empty, // Then get the POST_TYPE content layout. $content_layout = astra_get_option_meta( 'site-content-layout', '', true ); if ( empty( $content_layout ) ) { $post_type = get_post_type(); if ( 'post' === $post_type || 'page' === $post_type ) { $content_layout = astra_get_option( 'single-' . get_post_type() . '-content-layout' ); } if ( 'default' == $content_layout || empty( $content_layout ) ) { // Get the GLOBAL content layout value. // NOTE: Here not used `true` in the below function call. $content_layout = astra_get_option( 'site-content-layout', 'full-width' ); } } } else { $content_layout = ''; $post_type = get_post_type(); if ( 'post' === $post_type ) { $content_layout = astra_get_option( 'archive-' . get_post_type() . '-content-layout' ); } if ( is_search() ) { $content_layout = astra_get_option( 'archive-post-content-layout' ); } if ( 'default' == $content_layout || empty( $content_layout ) ) { // Get the GLOBAL content layout value. // NOTE: Here not used `true` in the below function call. $content_layout = astra_get_option( 'site-content-layout', 'full-width' ); } } return apply_filters( 'astra_get_content_layout', $content_layout ); }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |