init();
}
public function init(){
add_action('init', function(){
});
}
public function pagination(){
the_posts_pagination(
array(
'mid_size' => 5,
'prev_text' => __( 'Previous', 'appsense' ),
'next_text' => __( 'Next', 'appsense' ),
)
);
}
public function pageLink(){
wp_link_pages(
array(
'before' => '
' . esc_html( uiappsense_default_strings( 'string-blog-page-links-before', false ) ),
'after' => '
',
'link_before' => '',
'link_after' => '',
)
);
}
public function directory(){
/* Directory and Extension */
$dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
$file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
if ( apply_filters( 'theappsense_theme_editor_style', true ) ) {
add_editor_style( 'assets/css/' . $dir_name . '/editor-style' . $file_prefix . '.css' );
}
}
public function breadcrumb(){
echo 'Home';
if (is_category() || is_single()) {
echo " » ";
the_category(' • ');
if (is_single()) {
echo " » ";
the_title();
}
} elseif (is_page()) {
echo " » ";
echo the_title();
} elseif (is_search()) {
echo " » Search Results for... ";
echo '"';
echo the_search_query();
echo '"';
}
}
public function contentWidth(){
add_action( 'template_redirect', function(){
global $content_width;
/**
* Content Width
*/
if ( ! isset( $content_width ) ) {
if ( is_home() || is_post_type_archive( 'post' ) ) {
$blog_width = uiappsense_get_option( 'blog-width' );
if ( 'custom' === $blog_width ) {
$content_width = apply_filters( 'uiappsense_content_width', uiappsense_get_option( 'blog-max-width', 1200 ) );
}
} elseif ( is_single() ) {
if ( 'post' === get_post_type() ) {
$single_post_max = uiappsense_get_option( 'blog-single-width' );
if ( 'custom' === $single_post_max ) {
$content_width = apply_filters( 'uiappsense_content_width', uiappsense_get_option( 'blog-single-max-width', 1200 ) );
} else {
$content_width = apply_filters( 'uiappsense_content_width', uiappsense_get_option( 'site-content-width', 1200 ) );
}
}
// For custom post types set the global content width.
$content_width = apply_filters( 'uiappsense_content_width', uiappsense_get_option( 'site-content-width', 1200 ) );
} else {
$content_width = apply_filters( 'uiappsense_content_width', uiappsense_get_option( 'site-content-width', 1200 ) );
}
}
});
// Comment assets.
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
}
endif;
$appsense = new UI_Appsense();