<?php
/**
 * Custom functions that act independently of the theme templates
 *
 * Eventually, some of the functionality here could be replaced by core features.
 *
 * @package Poster
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;


/****************************************
Blog Posts Lists
*****************************************/
$poster_list_block_show_on = get_theme_mod('poster_list_block_posts_location', 'index');
$poster_ticker_location = get_theme_mod('poster_ticker_location', 'all_pages');
$poster_blocktiles_location = get_theme_mod('poster_blocktiles_location', 'all_pages');

if (get_theme_mod('poster_newticker_on') !=='disable') {
	if ($poster_ticker_location === 'all_pages' || ($poster_ticker_location === 'single' && is_single()) || ($poster_ticker_location === 'page' && is_page()) || ($poster_ticker_location === 'archive' && is_archive()) || ($poster_ticker_location === 'index' && (is_home() || is_front_page()))) {
		if (get_theme_mod('poster_newsticker_style') == 'styleone'){
			poster_newticker();
		}
		else if (get_theme_mod('poster_newsticker_style') == 'styletwo'){
			poster_newtickertwo();
		}
		else if (get_theme_mod('poster_newsticker_style') == 'stylethree'){
			poster_marqueeticker();
		}
		else{
			poster_newticker();
		}
	}
}
if(get_theme_mod('poster_listblock_postson') === 'enable'){
	if ($poster_list_block_show_on === 'all_pages' || ($poster_list_block_show_on === 'single' && is_single()) || ($poster_list_block_show_on === 'page' && is_page()) || ($poster_list_block_show_on === 'archive' && is_archive()) || ($poster_list_block_show_on === 'index' && (is_home() || is_front_page()))) {
		poster_listblockposts();
	}
}

if(get_theme_mod('poster_blocktiles_on') !=='disable'){
	if ($poster_blocktiles_location === 'all_pages' || ($poster_blocktiles_location === 'single' && is_single()) || ($poster_blocktiles_location === 'page' && is_page()) || ($poster_blocktiles_location === 'archive' && is_archive()) || ($poster_blocktiles_location === 'index' && (is_home() || is_front_page()))) {
		poster_blocktilesposts();
	}
}