* Created on: 26/07/2018
*
* @soundtrack Into the Sun (EP Version) - Sons Of The East
* @package Hestia
*/
/**
* Class Hestia_Blog_Post_Layout
*/
class Hestia_Blog_Post_Layout {
/**
* Initialize the post layout manager.
*/
public function init() {
add_action( 'hestia_blog_post_template_part', array( $this, 'render' ), 2 );
}
/**
* Main render function.
*
* @param string $layout post layout.
*/
public function render( $layout ) {
$pid = get_the_ID();
$article_class = $this->get_article_class( $layout );
$wrapper_class = $this->get_wrapper_class( $layout );
$row_class = 'row ';
if ( $layout === 'alt-1' ) {
$row_class = 'row alternative-blog-row ';
}
$settings = array(
'pid' => $pid,
'article_class' => $article_class,
'wrapper_class' => $wrapper_class,
'row_class' => $row_class,
'layout' => $layout,
);
if ( is_search() ) {
do_action( 'hestia_before_search_content' );
}
echo $this->get_article( $settings );
}
/**
* Get an article.
*
* @param array $args Article arguments.
*/
public function get_article( $args = array() ) {
$article_template = '';
$article_template .= '