$word_limit)
array_pop($words);
return implode(' ', $words);
}
if ( ! isset( $content_width ) )
$content_width = 640; /* pixels */
if ( ! function_exists( 'skt_photo_world_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*/
function skt_photo_world_setup() {
load_theme_textdomain( 'skt-photo-world', get_template_directory() . '/languages' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'woocommerce' );
add_image_size('homepage-thumb',240,145,true);
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'skt-photo-world' ),
) );
register_nav_menus( array(
'main' => __( 'Main Menu', 'skt-photo-world' ),
) );
register_nav_menus( array(
'useful' => __( 'Useful Links', 'skt-photo-world' ),
) );
add_theme_support( 'custom-background', array(
'default-color' => '4486bf',
'default-image' => get_template_directory_uri().'/images/banner_bg.jpg',
) );
add_editor_style( 'editor-style.css' );
}
endif; // skt_photo_world_setup
add_action( 'after_setup_theme', 'skt_photo_world_setup' );
function skt_photo_world_widgets_init() {
register_sidebar( array(
'name' => __( 'Blog Sidebar', 'skt-photo-world' ),
'description' => __( 'Appears on blog page sidebar', 'skt-photo-world' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
}
add_action( 'widgets_init', 'skt_photo_world_widgets_init' );
if ( !function_exists( 'optionsframework_init' ) ) {
define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/' );
require_once dirname( __FILE__ ) . '/inc/options-framework.php';
}
function skt_photo_world_scripts() {
wp_enqueue_style( 'skt_photo_world-gfonts', '//fonts.googleapis.com/css?family=Roboto+Condensed:400,300,300italic,400italic,700,700italic' );
wp_enqueue_style( 'skt_photo_world-fonts', '//fonts.googleapis.com/css?family=Roboto:400,300,700');
wp_enqueue_style( 'skt_photo_world-basic-style', get_stylesheet_uri() );
if ( (function_exists( 'of_get_option' )) && (of_get_option('sidebar-layout', true) != 1) ) {
if (of_get_option('sidebar-layout', true) == 'right') {
wp_enqueue_style( 'skt_photo_world-layout', get_template_directory_uri()."/css/layouts/content-sidebar.css" );
}
else {
wp_enqueue_style( 'skt_photo_world-layout', get_template_directory_uri()."/css/layouts/sidebar-content.css" );
}
}
else {
wp_enqueue_style( 'skt_photo_world-layout', get_template_directory_uri()."/css/layouts/content-sidebar.css" );
}
wp_enqueue_style( 'skt_photo_world-editor-style', get_template_directory_uri()."/editor-style.css", array('skt_photo_world-layout') );
wp_enqueue_style( 'skt_photo_world-main-style', get_template_directory_uri()."/css/main.css", array('skt_photo_world-layout') );
wp_enqueue_style( 'skt_photo_world-supersized-default-theme', get_template_directory_uri()."/css/supersized.css" );
wp_enqueue_style( 'skt_photo_world-supersized-style', get_template_directory_uri()."/css/supersized.shutter.css" );
wp_enqueue_script( 'skt_photo_world-supersized-slider', get_template_directory_uri() . '/js/supersized.3.2.7.min.js', array('jquery') );
//wp_enqueue_script( 'skt_photo_world-superfish', get_template_directory_uri() . '/js/superfish.js', array('jquery') );
wp_enqueue_script( 'skt_photo_world-supersized-shutter', get_template_directory_uri() . '/js/supersized.shutter.js', array('jquery') );
wp_enqueue_script( 'skt_photo_world-shutter-min', get_template_directory_uri() . '/theme/supersized.shutter.min.js', array('jquery') );
wp_enqueue_script( 'skt_photo_world-shutter', get_template_directory_uri() . '/theme/supersized.shutter.js', array('jquery') );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'skt_photo_world_scripts' );
function skt_photo_world_custom_head_codes() {
if ( (function_exists( 'of_get_option' )) && (of_get_option('headcode1', true) != 1) ) {
echo esc_html( of_get_option('headcode1', true) );
}
if ( (function_exists( 'of_get_option' )) && (of_get_option('style2', true) != 1) ) {
echo "";
}
//Modify CSS a little if Slider is disabled.
if ( ( of_get_option('slider_enabled') == 0 ) || ( (is_home() == false) ) ) {
echo "";
}
if ( ( of_get_option('slider_enabled') == 0 ) || ( (is_front_page() == true) ) ) {
echo "";
}
if ( function_exists( 'of_get_option' ) ) {
echo "";
}
?> str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'type' => 'array'
) );
if( is_array($page_format) ) {
$paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged');
echo '';
}
}
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/**
* Load custom functions file.
*/
require get_template_directory() . '/inc/custom-functions.php';
function skt_photo_world_custom_blogpost_pagination( $wp_query ){
$big = 999999999; // need an unlikely integer
if ( get_query_var('paged') ) { $pageVar = 'paged'; }
elseif ( get_query_var('page') ) { $pageVar = 'page'; }
else { $pageVar = 'paged'; }
$pagin = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?'.$pageVar.'=%#%',
'current' => max( 1, get_query_var($pageVar) ),
'total' => $wp_query->max_num_pages,
'prev_text' => '« Prev',
'next_text' => 'Next »',
'type' => 'array'
) );
if( is_array($pagin) ) {
$paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged');
echo '';
}
}
function skt_photo_world_get_slug_by_id($id) {
$post_data = get_post($id, ARRAY_A);
$slug = $post_data['post_name'];
return $slug;
}