'."\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;
$arise_settings = arise_get_theme_options();
global $post;
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');
/********************** SCRIPTS FOR DONATE/ UPGRADE BUTTON ******************************/
function arise_customize_scripts() {
if(!class_exists('Arise_Plus_Features')){
wp_enqueue_script( 'arise_customizer_custom', get_template_directory_uri() . '/inc/js/customizer-custom-scripts.js', array( 'jquery' ), '20140108', true );
$arise_upgrade_links = array(
'upgrade_link' => esc_url('http://themefreesia.com/themes/arise'),
'upgrade_text' => __( 'Upgrade to Pro', 'arise' ),
);
wp_localize_script( 'arise_customizer_custom', 'arise_upgrade_links', $arise_upgrade_links );
wp_enqueue_script( 'arise_customizer_custom' );
}
wp_enqueue_style( 'arise_customizer_custom', get_template_directory_uri() . '/inc/js/arise-customizer.css');wp_enqueue_script( 'arise_customizer_custom' );
}
add_action( 'customize_controls_print_scripts', 'arise_customize_scripts');
/**************************** 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 displayblock";} else { $classes = "slides displaynone";}
$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'), '2.9999.5', 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-quote-slider', get_template_directory_uri().'/js/arise-quote-slider.js', array('jquery'),'4.2.2', true);
wp_enqueue_style( 'arise_google_fonts' );
wp_style_add_data('arise-ie', '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' );
?>