default_config = $conObj;
//add actions
add_action('smartlib_breadcrumb', array($this, 'smartlib_breadcrumb'), 10);
add_action('smartlib_footer_text', array($this, 'smartlib_footer_text'), 10);
add_action('smartlib_prev_next_post_navigation', array($this, 'smartlib_prev_next_post_navigation'), 10);
add_action('smartlib_custom_single_page_pagination', array($this, 'smartlib_custom_single_page_pagination'), 10, 1);
add_action('smartlib_comment_list', array($this, 'smartlib_comment_list'), 10);
add_action('smartlib_ie_support', array($this, 'smartlib_ie_support'), 10);
add_action('smartlib_excerpt_max_charlength', array($this, 'smartlib_excerpt_max_charlength'), 10, 1);
add_action('smartlib_display_postformat', array($this, 'smartlib_display_postformat'), 10, 1);
add_action('smartlib_display_meta_post', array($this, 'smartlib_display_meta_post'), 10, 1);
add_action('smartlib_mobile_menu', array($this, 'smartlib_mobile_menu'), 10, 1);
add_action('smartlib_date_and_link', array($this, 'smartlib_date_and_link'), 10, 1);
add_action('smartlib_comment_link_header', array($this, 'smartlib_comment_link_header'), 10);
add_action('smartlib_comments_count', array($this, 'smartlib_comments_count'), 10);
add_action('smartlib_category_line', array($this, 'smartlib_category_line'), 10, 1);
add_action('smartlib_get_layout_sidebar', array($this, 'smartlib_get_layout_sidebar'), 10, 1);
add_action('smartlib_get_related_post_box', array($this, 'smartlib_get_related_post_box'), 10, 2);
add_action('smartlib_dynamic_sidebar_grid', array($this, 'smartlib_dynamic_sidebar_grid'), 10, 1);
add_action('smartlib_password_form', array($this, 'smartlib_password_form'), 10);
add_action('smartlib_sticky_post_slider', array($this, 'smartlib_sticky_post_slider'), 10);
add_action('smartlib_social_links_area', array($this, 'smartlib_social_links_area'), 10, 1);
add_action('smartlib_footer_sidebar', array($this, 'smartlib_footer_sidebar'), 10, 1);
add_action('smartlib_author_line', array($this, 'smartlib_author_line'), 10, 1);
add_action('smartlib_entry_tags', array($this, 'smartlib_entry_tags'), 10, 1);
add_action('smartlib_block_date', array($this, 'smartlib_block_date'), 10);
add_action('smartlib_social_links', array($this, 'smartlib_social_links'), 10, 1);
/*pagination hooks*/
add_action('smartlib_prev_next_links', array($this, 'smartlib_prev_next_links'), 10);
add_action('smartlib_pagination_number_links', array($this, 'smartlib_pagination_number_links'), 10);
add_action('smartlib_before_content', array($this, 'smartlib_preloader'), 10);
add_action('smartlib_top_bar', array($this, 'smartlib_display_top_bar'), 10);
add_action('smartlib_post_header', array($this, 'smartlib_post_header'), 10);
add_action('smartlib_archive_header', array($this, 'smartlib_archive_header'), 10);
/*navigation actions*/
add_action('smartlib_top_search', array($this, 'smartlib_top_search'), 10);
/*footer actions*/
add_action('smartlib_after_content', array($this, 'smartlib_go_top_button'), 10);
/**
* Front Page Sections
*/
//get sections_order
add_action('smartlib_frontpage_sections', array($this, 'smartlib_frontpage_sections'));
}
/**
* Print breadcrumb trail
*/
function smartlib_breadcrumb()
{
global $post;
//Get bredcrumb separator option
$sep = ''.get_theme_mod('smartlib_breadcrumb_separator_page', '/'). ' ';
$display = get_theme_mod('smartlib_pages_breadcrumb_page', 1);
echo '
';
if (!is_front_page() && $display==1) {
echo '';
echo get_theme_mod('smartlib_breadcrumb_homepage_name', __('Home', 'bootframe-core'));
echo ' ' . $sep . ' ';
if (is_category() || is_single()) {
$args = array('fields' => 'all');
$categories = wp_get_post_categories( $post->ID, $args );
if(count($categories)){
foreach($categories as $category){
?>
name ?>
';
}
/**
* Display footer text
*/
public function smartlib_footer_text()
{
return get_theme_mod('footer_text');
}
/**
* Display meta line under post title - use for widgets, boxs
*
* @param string $type author|category|date
*/
function smartlib_display_meta_post($type = 'blog_loop')
{
?>
get_context_type($type);
$option = (int)$this->smartlib_get_option('smartlib_show_date_', $type, '1');
if ($option == 1) {
$time_string = '%2$s ';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '%2$s ';
}
$time_string = sprintf($time_string,
esc_attr(get_the_date('c')),
esc_html(get_the_date()),
esc_attr(get_the_modified_date('c')),
esc_html(get_the_modified_date())
);
$class = apply_filters('smartlib_conditional_class', '', 'smartlib_display_sidepanel_blog_single', '0');
printf(' %3$s ',
$class,
esc_url(get_permalink()),
$time_string
);
}
}
/**
* Get context type based on conditional tags and passed type
*
* @param $passed_type
*
* @return string
*/
public function get_context_type($passed_type)
{
global $post;
$type = '';
if ($passed_type == '') {
if (is_page()) {
$type = 'page';
}
if (is_single()) {
$type = 'blog_single';
}
if (is_archive()) {
$type = 'blog_loop';
}
if ($type == '') {
$type = 'default';
}
return $type;
} else {
return $passed_type;
}
}
/**
* Get theme option based on prefix and context - if not exists get default
* @param $prefix
* @param $type
* @param int $default
* @return int
*/
private function smartlib_get_option($prefix, $type, $default = 1)
{
$option = get_theme_mod($prefix . $type);
if ($option == '') {
$option = get_theme_mod($prefix . 'default', $default);
}
return (int)$option;
}
/**
* Get large date block on single post page
* @param string $type
*/
function smartlib_block_date($type = '')
{
$type = $this->get_context_type($type);
$option = $this->smartlib_get_option('smartlib_show_date_', $type, '1');
if ($option == '1') {
?>
%2$s %3$s ';
$time_string = sprintf($time_string,
esc_attr(get_the_date('c')),
esc_html(get_the_date('d')),
esc_html(get_the_date('M Y'))
);
echo $time_string;
}
}
/**
* Display comment link
*
* @param string $type
*/
public function smartlib_comment_link_header($type = '')
{
$type = $this->get_context_type($type);
$option = get_theme_mod('smartlib_show_replylink_' . $type, '1');
if ($option == '1') {
if (comments_open() && is_single()) {
?>
get_context_type($type);
$option = get_theme_mod('smartlib_show_category_' . $type, '1');
if ($option == '1') {
$category_list = get_the_category_list(__(' / ', 'bootframe-core'));
if (strlen($category_list > 0)) {
?>
get_context_type($type);
$option = get_theme_mod('smartlib_show_postformat_' . $type, '1');
$post_format = get_post_format($post->ID);
$promoted_formats = $this->default_config->get_promoted_formats();
if ($option == '1') {
if (in_array($post_format, $promoted_formats)) {
?>
str_replace($big, '%#%', get_pagenum_link($big)),
'current' => $current,
'total' => $wp_query->max_num_pages,
'mid_size' => 5,
'type' => 'array'
));
// Display the pagination if more than one page is found
if ($paginate_links) {
echo '
';
return $o;
}
/**
* Return version of homepage layout
* 1 - blog + sidebar
* 2 - classic blog
*
* @return mixed
*/
public function smartlib_version_homepage()
{
$version = get_theme_mod('project_homepage_version');
if (empty($version)) {
//return default (first value)
return 1;
}
return $version;
}
public function smartlib_sticky_post_slider()
{
$sticky = get_option('sticky_posts');
$args = array(
'post__in' => $sticky,
);
$slider_news = new WP_Query($args);
if ($slider_news->have_posts()) {
?>
have_posts()) {
$slider_news->the_post();
require_once locate_template('/views/snippets/sticky-slider.php');
}
?>
default_config->layout_class_array['author_meta_image'])
? $this->default_config->layout_class_array['author_meta_image'] : '';
if ($option == 1) {
?>
icon_awesome_translate_class
*
* @param $key
*
* @return mixed|void
*/
public function get_awesome_icon_class($key)
{
$icon_awesome_translate_class = $this->default_config->icon_awesome_translate_class;
if (isset($icon_awesome_translate_class[$key])) {
$icon_class = $icon_awesome_translate_class[$key];
} else {
$icon_class = $icon_awesome_translate_class['default_icon'];
}
return apply_filters('smartlib_icon_class', $icon_class);
}
/**
* Display social links
*/
public function smartlib_social_links_area($show_option)
{
global $post;
if ($show_option == 1) {
$facebook = get_theme_mod('smartlib_social_facebook_button_default', '1');
$twitter = get_theme_mod('smartlib_social_twitter_button_default', '1');
$pinterest = get_theme_mod('smartlib_social_pinterest_button_default', '1');
$gplus = get_theme_mod('smartlib_social_gplus_button_default', '1');
?>
smartlib_get_option('smartlib_show_top_bar_', $type, 1);
if (isset($post->ID))
$meta_option = get_post_meta($post->ID, 'smartlib_show_top_bar_page', true);
if (strlen($meta_option) > 0) {
$option = (int)$meta_option;
}
if ($option == 1){
require_once locate_template('/views/snippets/top-bar.php');
}
}
/**
* Display Search Form
*/
function smartlib_top_search($type = 'default')
{
$option = (int)$this->smartlib_get_option('smartlib_show_search_in_navbar_', $type, 2);
if ($option == 2)
require_once locate_template('/views/snippets/top-search.php');
}
function smartlib_social_links($area = 'top')
{
$config_media_options = $this->default_config->supported_social_media;
$option = (int)get_theme_mod('smartlib_display_social_links_' . $area, 1);
$i = 1;
if ($option == 1) {
?>
$row) {
$link = get_theme_mod('smartlib_socialmedia_link_' . $key, 1);
if (strlen($link) > 2) {
?>
ID)) {
$meta_option = get_post_meta($post->ID, 'smartlib_display_sidebar_footer_page', true);
}
if (strlen($meta_option) != 0) {
$show_sidebar = (int)$meta_option;
}
if ($show_sidebar == 1 && is_active_sidebar('sidebar-footer')) {
?>
default_config->get_frontpage_sections_order());
foreach($sections_order as $section_function){
if(is_callable(array($this, $section_function))){
$display = get_theme_mod($section_function.'_display', '1');
if($display=='1'){
call_user_func(array($this, $section_function));
}
}
}
}
/**
* Action - display latest post section
*/
function homepage_theme_last_posts_section()
{
global $title_last_post, $posts_array;
$title_last_post = get_theme_mod('homepage_theme_last_posts_section', __('Last Posts', 'bootframe-core'));
$args = array('posts_per_page' => 4, 'ignore_sticky_posts' => 1, 'post_type' => 'post');
$posts_array = new WP_Query($args);
locate_template('views/homepage-sections/latest-posts.php', true);
}
/**
* Display Services Section on Homepage
*
* @return mixed
*/
function homepage_theme_services_section()
{
global $boxes, $title_features;
$default_boxes = apply_filters('smartlib_default_theme_content', array());
$boxes = get_theme_mod('smartlib_service_box', $default_boxes['homepage']['sections']['services_section']);
$title_features = get_theme_mod('homepage_theme_services_section', __('Our Services', 'bootframe-core'));
locate_template('views/homepage-sections/services.php', true);
?>
0)
echo do_shortcode($slider_shortcode);
} else {
locate_template('views/homepage-sections/slider.php', true);
}
}
/**
* Display About Us Section
*/
function homepage_theme_custom_page_section(){
global $title_about_us, $post_content, $custom_image, $section_background;
$default_content = apply_filters('smartlib_default_theme_content', array());
$post_id = get_theme_mod('homepage_theme_custom_page_section_page_id', $default_content['homepage']['sections']['about_us_section']['about_us_page_id']);
$title_about_us = get_theme_mod('homepage_theme_custom_page_section_title', $default_content['homepage']['sections']['about_us_section']['about_us_section_title']);
$custom_image = get_theme_mod('homepage_theme_custom_page_section_image', $default_content['homepage']['sections']['about_us_section']['about_us_image']);
$section_background = get_theme_mod('homepage_theme_custom_page_section_background', $default_content['homepage']['sections']['about_us_section']['about_us_background']);
$post_content = get_post($post_id);
$query_args =
array(
'posts_per_page' => 1,
'post_type' => 'page',
'post__in' => array($post_id)
);
$post_content = new WP_Query($query_args);
locate_template('views/homepage-sections/about-us.php', true);
}
/**
* Action - display call to action
*/
function homepage_theme_call_to_action_section(){
global $title_call_to_action, $box_content, $section_background_image, $section_background, $call_to_action_label, $call_to_action_link, $box_attributes;
$default_content = apply_filters('smartlib_default_theme_content', array());
$title_call_to_action = get_theme_mod('homepage_theme_call_to_action_section_title', $default_content['homepage']['sections']['call_to_action_section']['call_to_action_title']);
$box_content = get_theme_mod('homepage_theme_call_to_action_section_content', $default_content['homepage']['sections']['call_to_action_section']['call_to_action_content']);
$call_to_action_label = get_theme_mod('homepage_theme_call_to_action_section_button_label', $default_content['homepage']['sections']['call_to_action_section']['call_to_action_button_label']);
$call_to_action_link = get_theme_mod('homepage_theme_call_to_action_section_button_link', $default_content['homepage']['sections']['call_to_action_section']['call_to_action_button_link']);
$section_background_image = get_theme_mod('homepage_theme_call_to_action_section_background_image', $default_content['homepage']['sections']['call_to_action_section']['call_to_action_background_image']);
$section_background = get_theme_mod('homepage_theme_call_to_action_section_background_color', $default_content['homepage']['sections']['call_to_action_section']['call_to_action_background_color']);
if(strlen($section_background)>0){
$box_attributes = 'data-type="background" data-overlay-color="data-overlay-color"';
}
locate_template('views/homepage-sections/call-to-action.php', true);
}
/**
* Action - display portfolio section
*/
function homepage_theme_portfolio_section()
{
global $title_portfolio, $portfolio_query, $columns_number_selection, $section_background, $section_background_image;
$default_content = apply_filters('smartlib_default_theme_content', array());
$columns_number_selection = 4;
$title_portfolio = get_theme_mod('smartlib_portfolio_section_title', $default_content['homepage']['sections']['portfolio_section']['portfolio_title']);
$portfolio_taxonomy = get_theme_mod('smartlib_portfolio_section_taxonomy', $default_content['homepage']['sections']['portfolio_section']['portfolio_taxonomy']);
$limit = get_theme_mod('smartlib_portfolio_section_limit', $default_content['homepage']['sections']['portfolio_section']['portfolio_number']);
$section_background = get_theme_mod('smartlib_portfolio_section_background_color', $default_content['homepage']['sections']['portfolio_section']['portfolio_background']);
if ($columns_number_selection > 0) {
$columns_per_slide = 12 / $columns_number_selection;
} else {
$columns_per_slide = 6;
}
$query_args =
array(
'posts_per_page' => $limit,
'post_type' => 'smartlib_portfolio',
);
if ($portfolio_taxonomy > 0) {
$tax_query['tax_query'] = array(
array(
'taxonomy' => 'portfolio_category',
'field' => 'ID',
'terms' => $portfolio_taxonomy
)
);
$query_args = array_merge($query_args, $tax_query);
}
$portfolio_query = new WP_Query($query_args);
locate_template('views/homepage-sections/portfolio.php', true);
}
/**
* Action - display contact front page section
*/
public function homepage_theme_contact_section(){
global $form_id, $title_contact, $contact_map, $section_background;
$default_content = apply_filters('smartlib_default_theme_content', array());
$title_contact = get_theme_mod('homepage_theme_contact_section_title', $default_content['homepage']['sections']['contact_section']['contact_title']);
$form_id = get_theme_mod('homepage_theme_contact_section_form', __SMARTLIB_HELPERS::get_default_form_ID());
$contact_map = get_theme_mod('homepage_theme_contact_section_map', $default_content['homepage']['sections']['contact_section']['contact_map']);
$section_background = get_theme_mod('smartlib_contact_section_background_color', $default_content['homepage']['sections']['contact_section']['contact_background']);
locate_template('views/homepage-sections/contact.php', true);
}
/**
* Action - our clients front page section
*/
public function homepage_theme_our_clients_section(){
global $boxes, $title_our_clients, $section_background;
$default_boxes = apply_filters('smartlib_default_theme_content', array());
$boxes = get_theme_mod('smartlib_our_clients_box', $default_boxes['homepage']['sections']['our_clients_section']['boxes']);
$title_our_clients = get_theme_mod('smartlib_our_clients_section_title', $default_boxes['homepage']['sections']['our_clients_section']['our_clients_title']);
$section_background = get_theme_mod('smartlib_our_clients_section_background_color', $default_boxes['homepage']['sections']['our_clients_section']['section_background']);
locate_template('views/homepage-sections/our-clients.php', true);
}
/**
* Action - Counter front page section
*/
public function homepage_theme_counter_section(){
global $boxes, $title_counter, $section_background, $section_background_image, $box_attributes;
$default_boxes = apply_filters('smartlib_default_theme_content', array());
$boxes = get_theme_mod('smartlib_counter_box', $default_boxes['homepage']['sections']['counter_section']['boxes']);
$title_counter = get_theme_mod('smartlib_counter_section_title', $default_boxes['homepage']['sections']['counter_section']['counter_title']);
$section_background = get_theme_mod('smartlib_counter_section_background_color', $default_boxes['homepage']['sections']['counter_section']['section_background']);
$section_background_image = get_theme_mod('homepage_theme_counter_section_background_image', $default_boxes['homepage']['sections']['counter_section']['counter_background_image']);
if(strlen($section_background)>0){
$box_attributes = 'data-type="background" data-overlay-color="data-overlay-color"';
}
locate_template('views/homepage-sections/counter.php', true);
}
/**
* Action - Features Icons page section
*/
public function homepage_theme_feature_icons_section(){
global $boxes, $title_feature_icons, $section_background;
$default_boxes = apply_filters('smartlib_default_theme_content', array());
$boxes = get_theme_mod('smartlib_feature_icons_box', $default_boxes['homepage']['sections']['features_icons_section']['boxes']);
$title_feature_icons = get_theme_mod('smartlib_feature_icons_section_title', $default_boxes['homepage']['sections']['features_icons_section']['features_icons_title']);
$section_background = get_theme_mod('smartlib_feature_icons_section_background', $default_boxes['homepage']['sections']['features_icons_section']['section_background']);
locate_template('views/homepage-sections/feature-icons.php', true);
}
/**
* Action - Testimonials page section
*/
public function homepage_theme_testimonials_section(){
global $title_testimonials, $testimonials_array, $section_background;
$default_boxes = apply_filters('smartlib_default_theme_content', array());
$title_testimonials = get_theme_mod('smartlib_testimonials_section_title', $default_boxes['homepage']['sections']['testimonials_section']['testimonials_title']);
$args = array('posts_per_page' => 4, 'ignore_sticky_posts' => 1, 'post_type' => 'smartlib_testimonial');
$testimonials_array = new WP_Query($args);
locate_template('views/homepage-sections/testimonials.php', true);
}
}
?>