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_header_page', array($this, 'smartlib_single_page_header'), 10); /*navigation actions*/ add_action('smartlib_top_bar', array($this, 'smartlib_display_top_bar'), 10); 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); } /** * Print breadcrumb trail */ function smartlib_breadcrumb() { global $post; //Get bredcrumb separator option $sep = ''.get_theme_mod('smartlib_breadcrumb_separator_page', '/'). ''; echo '
'; } /** * 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 = ''; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = ''; } $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 = (int)$this->smartlib_get_option('smartlib_show_date_', $type); if ($option == 1) { ?> '; $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 = (int)get_theme_mod('smartlib_show_replylink_' . $type, 1); if ($option == 1) { if (comments_open() && is_single()) { ?> get_context_type($type); $option = (int)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 = (int)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 '', ''); ?>