get_queried_object_id();
/**
* Loads up main stylesheet.
*/
wp_enqueue_style( 'adventurous-style', get_stylesheet_uri() );
// Add Genericons font, used in the main stylesheet.
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/css/genericons/genericons.css', false, '3.4.1' );
/**
* Loads up Responsive stylesheet
*/
wp_enqueue_style( 'adventurous-responsive', get_template_directory_uri() . '/css/responsive.css' );
/**
* Loads up Responsive Video Script
*/
wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/js/fitvids.min.js', array( 'jquery' ), '20140317', true );
/**
* Loads up jQuery Custom Scripts
*/
wp_enqueue_script( 'adventurous-custom', get_template_directory_uri() . '/js/adventurous-custom.min.js', array( 'jquery' ), '20150601', true );
/**
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
if ( is_singular() && wp_attachment_is_image() ) {
wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
}
/**
* Register JQuery circle all and JQuery set up as dependent on Jquery-cycle
*/
wp_register_script( 'jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.min.js', array( 'jquery' ), '20140317', true );
/**
* Loads up adventurous-slider and jquery-cycle set up as dependent on adventurous-slider
*/
$enableslider = $options[ 'enable_slider' ];
if ( ( $enableslider == 'enable-slider-allpage' ) || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && $enableslider == 'enable-slider-homepage' ) ) {
wp_enqueue_script( 'adventurous-slider', get_template_directory_uri() . '/js/adventurous-slider.js', array( 'jquery-cycle' ), '20140317', true );
}
// Load the html5 shiv.
wp_enqueue_script( 'catchresponsive-html5', get_template_directory_uri() . '/js/html5.min.js', array(), '3.7.3' );
wp_script_add_data( 'catchresponsive-html5', 'conditional', 'lt IE 9' );
/**
* Browser Specific Enqueue Script
*/
$adventurous_ua = strtolower($_SERVER['HTTP_USER_AGENT']);
if(preg_match('/(?i)msie [1-8]/',$adventurous_ua)) {
wp_enqueue_script( 'selectivizr', get_template_directory_uri() . '/js/selectivizr.min.js', array( 'jquery' ), '20130114', false );
wp_enqueue_style( 'adventurous-iecss', get_template_directory_uri() . '/css/ie.css' );
}
}
add_action( 'wp_enqueue_scripts', 'adventurous_scripts' );
/**
* Responsive Layout
*
* @get the data value of responsive layout from theme options
* @display responsive meta tag
* @action wp_head
*/
function adventurous_responsive() {
echo '';
} // adventurous_responsive
add_filter( 'wp_head', 'adventurous_responsive', 1 );
/**
* Get the favicon Image from theme options
*
* @uses favicon
* @get the data value of image from theme options
* @display favicon
*
* @uses default favicon if favicon field on theme options is empty
*
* @uses set_transient and delete_transient
*
* @remove Remove this function when WordPress 4.8 is released
*/
function adventurous_favicon() {
if ( function_exists( 'has_site_icon' ) ) {
//Bail Early if Core Site Icon Feature is Present
return;
}
if( ( !$adventurous_favicon = get_transient( 'adventurous_favicon' ) ) ) {
global $adventurous_options_settings;
$options = $adventurous_options_settings;
echo '';
if ( $options[ 'remove_favicon' ] == "0" ) :
// if not empty fav_icon on theme options
if ( !empty( $options[ 'fav_icon' ] ) ) :
$adventurous_favicon = '';
else:
// if empty fav_icon on theme options, display default fav icon
$adventurous_favicon = '';
endif;
endif;
set_transient( 'adventurous_favicon', $adventurous_favicon, 86940 );
}
echo $adventurous_favicon ;
} // adventurous_favicon
//Load Favicon in Header Section
add_action('wp_head', 'adventurous_favicon');
//Load Favicon in Admin Section
add_action( 'admin_head', 'adventurous_favicon' );
if ( ! function_exists( 'adventurous_content_image' ) ) :
/**
* Template for Featured Image in Content
*
* To override this in a child theme
* simply create your own adventurous_content_image(), and that function will be used instead.
*
* @since Adventurous 1.0
*/
function adventurous_content_image() {
global $post, $wp_query;
// Get Page ID outside Loop
$page_id = $wp_query->get_queried_object_id();
if( $post) {
if ( is_attachment() ) {
$parent = $post->post_parent;
$individual_featured_image = get_post_meta( $parent,'adventurous-featured-image', true );
} else {
$individual_featured_image = get_post_meta( $page_id,'adventurous-featured-image', true );
}
}
if( empty( $individual_featured_image ) || ( !is_page() && !is_single() ) ) {
$individual_featured_image='default';
}
// Getting data from Theme Options
global $adventurous_options_settings;
$options = $adventurous_options_settings;
$featured_image = $options['featured_image'];
if ( ( $individual_featured_image == 'disable' || '' == get_the_post_thumbnail() || ( $individual_featured_image=='default' && $featured_image == 'disable') ) ) {
return false;
}
else { ?>