', $new_markup);
return $new_markup; }
add_filter( 'wp_page_menu', 'adventurous_wp_page_menu' );
if ( ! function_exists( 'adventurous_main_wrapper' ) ) :
/**
* Open Div ID main
*
*/
function adventurous_main_wrapper() {
echo '
';
}
endif; // adventurous_main_wrapper
if ( ! function_exists( 'adventurous_main_wrapper_close' ) ) :
/**
* Close Div ID main
*
*/
function adventurous_main_wrapper_close() {
echo '
';
}
endif; // adventurous_main_wrapper_close
if ( ! function_exists( 'adventurous_content_sidebar_wrapper' ) ) :
/**
* Open Div ID content-sidebar
*
*/
function adventurous_content_sidebar_wrapper() {
echo '
';
}
endif; // adventurous_content_sidebar_wrapper
if ( ! function_exists( 'adventurous_content_sidebar_wrapper_close' ) ) :
/**
* Close Div ID content-sidebar
*
*/
function adventurous_content_sidebar_wrapper_close() {
echo '
';
}
endif; // adventurous_content_sidebar_wrapper_close
if ( ! function_exists( 'content_sidebar_check' ) ) :
/**
* Cheking in Condition for main Wrap
*
*/
function content_sidebar_check() {
global $post, $wp_query, $adventurous_options_settings;
// Getting data from Theme Options
$options = $adventurous_options_settings;
$enable_post = $options[ 'enable_posts_home' ];
// Front page displays in Reading Settings
$page_on_front = get_option('page_on_front') ;
$page_for_posts = get_option('page_for_posts');
// Get Page ID outside Loop
$page_id = $wp_query->get_queried_object_id();
if ( is_front_page() && is_home() && !empty( $enable_post ) ) {
return;
}
elseif ( is_front_page() ) {
add_action( 'adventurous_main', 'adventurous_main_wrapper', 10 );
add_action( 'adventurous_content_sidebar', 'adventurous_content_sidebar_wrapper', 10 );
add_action( 'adventurous_content_sidebar_close', 'adventurous_content_sidebar_wrapper_close', 10 );
add_action( 'adventurous_main_close', 'adventurous_main_wrapper_close', 10 );
}
elseif ( is_home() && !empty( $enable_post ) && empty( $page_id ) ) {
return;
}
else {
add_action( 'adventurous_main', 'adventurous_main_wrapper', 10 );
add_action( 'adventurous_content_sidebar', 'adventurous_content_sidebar_wrapper', 10 );
add_action( 'adventurous_content_sidebar_close', 'adventurous_content_sidebar_wrapper_close', 10 );
add_action( 'adventurous_main_close', 'adventurous_main_wrapper_close', 10 );
}
}
endif; // content_sidebar_check
add_action( 'adventurous_before_main', 'content_sidebar_check', 20 );
/**
* Footer Sidebar
*
* @Hooked in adventurous_footer
* @since Adventurous 1.0
*/
function adventurous_footer_sidebar() {
get_sidebar( 'footer' );
}
add_action( 'adventurous_footer', 'adventurous_footer_sidebar', 10 );
/**
* Count the number of footer sidebars to enable dynamic classes for the footer
*/
function adventurous_footer_sidebar_class() {
$count = 0;
if ( is_active_sidebar( 'sidebar-2' ) )
$count++;
if ( is_active_sidebar( 'sidebar-3' ) )
$count++;
if ( is_active_sidebar( 'sidebar-4' ) )
$count++;
if ( is_active_sidebar( 'sidebar-5' ) )
$count++;
$class = '';
switch ( $count ) {
case '1':
$class = 'one container';
break;
case '2':
$class = 'two container';
break;
case '3':
$class = 'three container';
break;
case '4':
$class = 'four container';
break;
}
if ( $class )
echo 'class="' . $class . '"';
}
/**
* Footer Site Generator Open
*
* @Hooked in adventurous_site_generator
* @since Adventurous 1.0
*/
function adventurous_site_generator_open() {
echo '
';
}
add_action( 'adventurous_site_generator', 'adventurous_site_generator_open', 10 );
/**
* Footer Site Generator Close
*
* @Hooked in adventurous_site_generator
* @since Adventurous 1.0
*/
function adventurous_site_generator_close() {
echo '
';
}
add_action( 'adventurous_site_generator', 'adventurous_site_generator_close', 100 );
if ( ! function_exists( 'adventurous_footer_content' ) ) :
/**
* Template for Footer Content
*
* To override this in a child theme
* simply create your own adventurous_footer_content(), and that function will be used instead.
*
* @uses adventurous_site_generator action to add it in the footer
* @since Adventurous 1.0
*/
function adventurous_footer_content() {
//delete_transient( 'adventurous_footer_content' );
if ( ( !$adventurous_footer_content = get_transient( 'adventurous_footer_content' ) ) ) {
echo '';
// get the data value from theme options
global $adventurous_options_settings;
$options = $adventurous_options_settings;
// $adventurous_footer_content = $options[ 'footer_code' ];
$adventurous_footer_content = $options[ 'footer_code' ];
set_transient( 'adventurous_footer_content', $adventurous_footer_content, 86940 );
}
echo do_shortcode( $adventurous_footer_content );
}
endif;
add_action( 'adventurous_site_generator', 'adventurous_footer_content', 20 );
/**
* Alter the query for the main loop in homepage
* @uses pre_get_posts hook
*/
function adventurous_alter_home( $query ){
global $adventurous_options_settings;
$options = $adventurous_options_settings;
$cats = $options[ 'front_page_category' ];
if ( $options[ 'exclude_slider_post'] != "0" && !empty( $options[ 'featured_slider' ] ) ) {
if( $query->is_main_query() && $query->is_home() ) {
$query->query_vars['post__not_in'] = $options[ 'featured_slider' ];
}
}
if ( !in_array( '0', $cats ) ) {
if( $query->is_main_query() && $query->is_home() ) {
$query->query_vars['category__in'] = $options[ 'front_page_category' ];
}
}
}
add_action( 'pre_get_posts','adventurous_alter_home' );
if ( ! function_exists( 'adventurous_social_networks' ) ) :
/**
* Template for Social Icons
*
* To override this in a child theme
* simply create your own adventurous_social_networks(), and that function will be used instead.
*
* @since Adventurous 1.0
*/
function adventurous_social_networks() {
//delete_transient( 'adventurous_social_networks' );
// get the data value from theme options
global $adventurous_options_settings;
$options = $adventurous_options_settings;
$elements = array();
$elements = array( $options[ 'social_facebook' ],
$options[ 'social_twitter' ],
$options[ 'social_googleplus' ],
$options[ 'social_linkedin' ],
$options[ 'social_pinterest' ],
$options[ 'social_youtube' ],
$options[ 'social_vimeo' ],
$options[ 'social_slideshare' ],
$options[ 'social_foursquare' ],
$options[ 'social_flickr' ],
$options[ 'social_tumblr' ],
$options[ 'social_deviantart' ],
$options[ 'social_dribbble' ],
$options[ 'social_myspace' ],
$options[ 'social_wordpress' ],
$options[ 'social_rss' ],
$options[ 'social_delicious' ],
$options[ 'social_lastfm' ],
$options[ 'social_instagram' ],
$options[ 'social_github' ],
$options[ 'social_vkontakte' ],
$options[ 'social_myworld' ],
$options[ 'social_odnoklassniki' ],
$options[ 'social_goodreads' ],
$options[ 'social_skype' ],
$options[ 'social_soundcloud' ]
);
$flag = 0;
if( !empty( $elements ) ) {
foreach( $elements as $option) {
if( !empty( $option ) ) {
$flag = 1;
}
else {
$flag = 0;
}
if( $flag == 1 ) {
break;
}
}
}
if ( ( !$adventurous_social_networks = get_transient( 'adventurous_social_networks' ) ) && ( $flag == 1 || !empty ( $options[ 'social_custom_image' ] ) ) ) {
echo '';
$adventurous_social_networks .='