default_config = $conObj; //add actions add_action('blogrock_breadcrumb', array($this, 'blogrock_breadcrumb'), 10); add_action('blogrock_footer_text', array($this, 'blogrock_footer_text'), 10); add_action('blogrock_prev_next_post_navigation', array($this, 'blogrock_prev_next_post_navigation'), 10); add_action('blogrock_custom_single_page_pagination', array($this, 'blogrock_custom_single_page_pagination'), 10, 1); add_action('blogrock_comment_list', array($this, 'blogrock_comment_list'), 10); add_action('blogrock_excerpt_max_charlength', array($this, 'blogrock_excerpt_max_charlength'), 10, 1); add_action('blogrock_display_postformat', array($this, 'blogrock_display_postformat'), 10, 1); add_action('blogrock_display_meta_post', array($this, 'blogrock_display_meta_post'), 10, 1); add_action('blogrock_mobile_menu', array($this, 'blogrock_mobile_menu'), 10, 1); add_action('blogrock_date_and_link', array($this, 'blogrock_date_and_link'), 10, 1); add_action('blogrock_comment_link_header', array($this, 'blogrock_comment_link_header'), 10); add_action('blogrock_comments_count', array($this, 'blogrock_comments_count'), 10); add_action('blogrock_category_line', array($this, 'blogrock_category_line'), 10, 1); add_action('blogrock_get_layout_sidebar', array($this, 'blogrock_get_layout_sidebar'), 10, 1); add_action('blogrock_get_related_post_box', array($this, 'blogrock_get_related_post_box'), 10, 2); add_action('blogrock_dynamic_sidebar_grid', array($this, 'blogrock_dynamic_sidebar_grid'), 10, 1); add_action('blogrock_password_form', array($this, 'blogrock_password_form'), 10); add_action('blogrock_sticky_post_slider', array($this, 'blogrock_sticky_post_slider'), 10); add_action('blogrock_footer_sidebar', array($this, 'blogrock_footer_sidebar'), 10, 1); add_action('blogrock_author_line', array($this, 'blogrock_author_line'), 10, 1); add_action('blogrock_entry_tags', array($this, 'blogrock_entry_tags'), 10, 1); add_action('blogrock_block_date', array($this, 'blogrock_block_date'), 10); add_action('blogrock_social_links', array($this, 'blogrock_social_links'), 10, 1); /*pagination hooks*/ add_action('blogrock_prev_next_links', array($this, 'blogrock_prev_next_links'), 10); add_action('blogrock_pagination_number_links', array($this, 'blogrock_pagination_number_links'), 10); add_action('blogrock_before_content', array($this, 'blogrock_preloader'), 10); add_action('blogrock_header_page', array($this, 'blogrock_single_page_header'), 10); /*navigation actions*/ add_action('blogrock_top_bar', array($this, 'blogrock_display_top_bar'), 10); add_action('blogrock_top_search', array($this, 'blogrock_top_search'), 10); /*footer actions*/ add_action('blogrock_after_content', array($this, 'blogrock_go_top_button'), 10); } /** * Print breadcrumb trail */ function blogrock_breadcrumb() { global $post; //Get bredcrumb separator option $sep = ''.get_theme_mod('blogrock_breadcrumb_separator_page', '/'). ''; echo '
'; } /** * Display footer text */ public function blogrock_footer_text() { return esc_html(get_theme_mod('blogrock_text_footer')); } /** * Display meta line under post title - use for widgets, boxs * * @param string $type author|category|date */ function blogrock_display_meta_post($type = 'blog_loop') { ?> get_context_type($type); $option = (int) esc_attr( $this->blogrock_get_option('blogrock_show_date_', $type, '1') ); if ($option == 1) { $time_string = ''; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = ''; } $archive_year = get_the_time('Y'); $archive_month = get_the_time('m'); $archive_day = get_the_time('d'); $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('blogrock_conditional_class', '', 'blogrock_display_sidepanel_blog_single', '0'); printf(' %3$s', esc_attr( $class ), esc_url(get_day_link($archive_year, $archive_month, $archive_day)), $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 blogrock_get_option($prefix, $type, $default = 1) { $option = esc_attr( get_theme_mod($prefix . $type) ); if ($option == '') { $option = esc_attr( get_theme_mod($prefix . 'default', $default) ); } return (int)$option; } /** * Get large date block on single post page * @param string $type */ function blogrock_block_date($type = '') { $type = $this->get_context_type($type); $option = (int) esc_attr( $this->blogrock_get_option('blogrock_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 esc_attr( $time_string ); } } /** * Display comment link * * @param string $type */ public function blogrock_comment_link_header($type = '') { $type = $this->get_context_type($type); $option = (int) esc_attr( get_theme_mod('blogrock_show_replylink_' . $type, 1)); if ($option == 1) { if (comments_open() && is_single()) { ?> get_context_type($type); $option = (int) esc_attr( get_theme_mod('blogrock_show_category_' . $type, '1')); if ($option == 1) { $category_list = get_the_category_list(__(' / ', 'blogrock-core')); if (strlen($category_list > 0)) { ?> get_context_type($type); $option = (int)$this->blogrock_get_option('blogrock_show_postformat_', $type, 1); $post_format = esc_attr( 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 '', ''); ?>