'."\n";
$arise_internal_css .= ''."\n";
}
if (isset($arise_internal_css)) {
echo $arise_internal_css;
}
}
add_filter( 'wp_head', 'arise_resp_and_custom_css');
/******************************** EXCERPT LENGTH *********************************/
function arise_arise_excerpt_length($length) {
$arise_settings = arise_get_theme_options();
$arise_excerpt_length = $arise_settings['arise_excerpt_length'];
return absint($arise_excerpt_length);// this will return 30 words in the excerpt
}
add_filter('excerpt_length', 'arise_arise_excerpt_length');
/********************* CONTINUE READING LINKS FOR EXCERPT *********************************/
function arise_continue_reading() {
return '… ';
}
add_filter('excerpt_more', 'arise_continue_reading');
/***************** USED CLASS FOR BODY TAGS ******************************/
function arise_body_class($classes) {
global $arise_site_layout, $arise_content_layout, $post;
$arise_settings = arise_get_theme_options();
if ($post) {
$layout = get_post_meta($post->ID, 'arise_sidebarlayout', true);
}
$arise_site_layout = $arise_settings['arise_design_layout'];
$arise_blog_layout_temp = $arise_settings['arise_blog_layout_temp'];
$arise_content_layout = $arise_settings['arise_sidebar_layout_options'];
if (empty($layout) || is_archive() || is_search() || is_home()) {
$layout = 'default';
}
if(!is_page_template('page-templates/arise-corporate.php')) {
if ('default' == $layout) {
$themeoption_layout = $arise_content_layout;
if ('left' == $themeoption_layout) {
$classes[] = 'left-sidebar-layout';
} elseif ('right' == $themeoption_layout) {
$classes[] = '';
} elseif ('fullwidth' == $themeoption_layout) {
$classes[] = 'full-width-layout';
} elseif ('nosidebar' == $themeoption_layout) {
$classes[] = 'no-sidebar-layout';
}
} elseif ('left-sidebar' == $layout) {
$classes[] = 'left-sidebar-layout';
} elseif ('right-sidebar' == $layout) {
$classes[] = '';//css blank
} elseif ('full-width' == $layout) {
$classes[] = 'full-width-layout';
} elseif ('no-sidebar' == $layout) {
$classes[] = 'no-sidebar-layout';
}
if($arise_blog_layout_temp == 'large_image_display'){
$classes[] = "blog-large";
}elseif ($arise_blog_layout_temp == 'medium_image_display'){
$classes[] = "small_image_blog";
}
}
if (!is_page_template('page-templates/arise-corporate.php') && !is_page_template('alter-front-page-template.php') ){
$classes[] = '';
}elseif (is_page_template('page-templates/arise-corporate.php')) {
$classes[] = 'tf-business-template';
$classes[] = 'page-template-default';
}
if (is_page_template('page-templates/page-template-contact.php')) {
$classes[] = 'contact';
}
if ($arise_site_layout =='boxed-layout') {
$classes[] = 'boxed-layout';
}
if ($arise_site_layout =='small-boxed-layout') {
$classes[] = 'boxed-layout-small';
}
return $classes;
}
add_filter('body_class', 'arise_body_class');
/**************************** SOCIAL MENU *********************************************/
function arise_social_links() {
if ( has_nav_menu( 'social-link' ) ) : ?>
'',
'theme_location' => 'social-link',
'depth' => 1,
'items_wrap' => '
',
'link_before' => '
',
'link_after' => '',
) );
?>
';
$get_featured_posts = new WP_Query(array( 'posts_per_page'=> $arise_settings['arise_slider_no'], 'post_type' => array('page'), 'post__in' => $arise_list_page, 'orderby' => 'post__in', ));
$i = 0;
while ($get_featured_posts->have_posts()):$get_featured_posts->the_post();
$attachment_id = get_post_thumbnail_id();
$image_attributes = wp_get_attachment_image_src($attachment_id,'arise_slider_image');
$i++;
$title_attribute = apply_filters('the_title', get_the_title($post->ID));
$excerpt = get_the_excerpt();
if (1 == $i) {$classes = "slides show-display";} else { $classes = "slides hide-display";}
$arise_page_sliders_display .= '
';
if ($image_attributes) {
$arise_page_sliders_display .= '
';
}
if ($title_attribute != '' || $excerpt != '') {
$arise_page_sliders_display .= '
';
$remove_link = $arise_settings['arise_slider_link'];
if($remove_link == 0){
if ($title_attribute != '') {
$arise_page_sliders_display .= '';
}
}else{
$arise_page_sliders_display .= ''.get_the_title().'
';
}
if ($excerpt != '') {
$excerpt_text = $arise_settings['arise_tag_text'];
$arise_page_sliders_display .= '';
$arise_page_sliders_display .= '
'.$excerpt.'
';
$arise_page_sliders_display .= '';
}
$arise_page_sliders_display .=' ';
}
if ($image_attributes) {
$arise_page_sliders_display .='
';
}
$arise_page_sliders_display .='
';
endwhile;
wp_reset_postdata();
$arise_page_sliders_display .= '
';
}
echo $arise_page_sliders_display;
}
/*************************** ENQUEING STYLES AND SCRIPTS ****************************************/
function arise_scripts() {
$arise_settings = arise_get_theme_options();
wp_enqueue_style( 'arise-style', get_stylesheet_uri() );
wp_enqueue_script('jquery_cycle_all', get_template_directory_uri().'/js/jquery.cycle.all.js', array('jquery'), '3.0.3', true);
wp_register_style( 'arise_google_fonts', '//fonts.googleapis.com/css?family=Roboto:400,300,500,700' );
$enable_slider = $arise_settings['arise_enable_slider'];
$arise_stick_menu = $arise_settings['arise_stick_menu'];
wp_enqueue_script('arise_slider', get_template_directory_uri().'/js/arise-slider-setting.js', array('jquery_cycle_all'), false, true);
wp_enqueue_script('arise-main', get_template_directory_uri().'/js/arise-main.js', array('jquery'));
if($arise_stick_menu != 1):
wp_enqueue_script('sticky-scroll', get_template_directory_uri().'/js/arise-sticky-scroll.js', array('jquery'));
endif;
wp_enqueue_script('arise-navigation', get_template_directory_uri().'/js/navigation.js', array('jquery'), false, true);
wp_enqueue_script('arise-quote-slider', get_template_directory_uri().'/js/arise-quote-slider.js', array('jquery'),'4.2.2', true);
wp_enqueue_style( 'arise_google_fonts' );
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' );
// Load the html5 shiv.
wp_enqueue_script( 'html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' );
wp_script_add_data( 'html5', 'conditional', 'lt IE 9' );
if( $arise_settings['arise_responsive'] == 'on' ) {
wp_enqueue_style('arise-responsive', get_template_directory_uri().'/css/responsive.css');
}
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'arise_scripts' );
/*************************** Importing Custom CSS to the core option added in WordPress 4.7. ****************************************/
function arise_custom_css_migrate(){
$ver = get_theme_mod( 'custom_css_version', false );
if ( version_compare( $ver, '4.7' ) >= 0 ) {
return;
}
if ( function_exists( 'wp_update_custom_css_post' ) ) {
$arise_settings = arise_get_theme_options();
if ( $arise_settings['arise_custom_css'] != '' ) {
$arise_core_css = wp_get_custom_css(); // Preserve css which is added from core
$return = wp_update_custom_css_post( $arise_core_css . $arise_settings['arise_custom_css'] );
if ( ! is_wp_error( $return ) ) {
unset( $arise_settings['arise_custom_css'] );
set_theme_mod( 'arise_theme_options', $arise_settings );
set_theme_mod( 'custom_css_version', '4.7' );
}
}
}
}
add_action( 'after_setup_theme', 'arise_custom_css_migrate' );