"EEEEEE")); add_filter('use_default_gallery_style', '__return_false'); } /* Blog info */ function acation_site_info($show_desc = true) { $site_title = get_bloginfo('name'); echo '

'.$site_title.'

'; if(trim(get_bloginfo('description')) != "" and $show_desc) { echo '

'.get_bloginfo('description').'

'; } } /* Custom header style */ function acation_header_style() { global $acation_options; $text_color = trim(get_header_textcolor()); $header_image = trim(get_header_image()); if($text_color == "") $text_color = "ffffff"; if($header_image != "") $header_img_style = 'background-image: url('.$header_image.'); background-repeat: repeat;'; if(!display_header_text()) $text_style = 'display: none;'; ?>
'ffffff', 'default-image' => '', 'width' => 1500, 'max-width' => 2000, 'height' => 180, 'flex-height' => true, 'flex-width' => true, 'random-default' => false, 'wp-head-callback' => 'acation_header_style', 'admin-head-callback' => 'acation_header_admin_style', 'admin-preview-callback' => 'acation_custom_header_admin_display' ); add_theme_support('custom-header', $args); } add_action('after_setup_theme', 'acation_custom_header'); /* Adding IE related scripts to head */ function acation_enqueue_ie_scripts() { echo ''."\n"; echo ''."\n"; echo ''."\n"; } add_action('wp_head','acation_enqueue_ie_scripts'); /* Custom CSS */ function acation_custom_css() { global $acation_options; ?> __('Primary Sidebar', 'acation'), 'id' => 'sidebar-1', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Widget Area 1', 'acation'), 'id' => 'sidebar-2', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Widget Area 2', 'acation'), 'id' => 'sidebar-3', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Widget Area 3', 'acation'), 'id' => 'sidebar-4', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'acation_widgets_init'); /* Count number of footer widget areas to enable dynamic footer classes */ function acation_footer_widget_class() { $count = 0; if(is_active_sidebar('sidebar-2')) $count++; if(is_active_sidebar('sidebar-3')) $count++; if(is_active_sidebar('sidebar-4')) $count++; $class = ''; switch($count) { case '1': $class = 'one'; break; case '2': $class = 'two'; break; case '3': $class = 'three'; break; } if($class) echo 'class="clearfix '.$class.'"'; } /* Default menu to use if custom menu is not used */ function acation_page_menu_args($args) { $args['show_home'] = false; $args['menu_class'] = 'primary-menu'; return $args; } add_filter('wp_page_menu_args', 'acation_page_menu_args'); /* Responsive dropdown navigation */ function acation_responsive_menu() { $location = 'primary'; $menu_id = ""; $current_page_url = get_permalink(); $locations = get_nav_menu_locations(); $output = ''; if(has_nav_menu($location)) { $menu = wp_get_nav_menu_object($locations[$location]); $menu_id = $menu->term_id; $menu_items = wp_get_nav_menu_items($menu_id); $output .= ''; } else { $menu_items = get_pages('hierarchical=0'); $output .= ''; } echo $output; } /* Filters title for the site */ function acation_filter_wp_title($title) { $site_name = get_bloginfo('name'); if(trim($title) != '') { $title = str_replace('»','',$title); $filtered_title = $title.' | '.$site_name; } else $filtered_title = $site_name; if (is_front_page()) { $site_description = get_bloginfo('description'); if(trim($site_description) != '') $filtered_title .= ' | '.$site_description; } return $filtered_title; } add_filter('wp_title', 'acation_filter_wp_title'); /* Favicon */ function acation_site_favicon() { global $acation_options; if(trim($acation_options['favicon']) != "") { echo ''."\n"; } } add_action('wp_head','acation_site_favicon'); /* Website logo */ function acation_site_logo() { global $acation_options; if(trim($acation_options['logo']) != "") { echo ''; } } /* Enqueue javascript and stylesheet */ function acation_enqueue_scripts() { global $acation_options; if(is_admin()) return; if(is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); wp_enqueue_script('jquery'); wp_enqueue_script('acation_masonry_js', get_template_directory_uri().'/js/masonry.pkgd.min.js','jquery'); wp_enqueue_script('acation_imagesloaded_js', get_template_directory_uri().'/js/imagesloaded.pkgd.min.js','jquery'); wp_enqueue_script('acation_theme_js', get_template_directory_uri().'/js/theme.js','jquery'); wp_enqueue_script('acation_prettyPhoto_js', get_template_directory_uri().'/js/jquery.prettyPhoto.js','jquery'); wp_enqueue_script('acation_flexslider_js', get_template_directory_uri().'/js/jquery.flexslider-min.js','jquery'); wp_enqueue_script('acation_retina_js', get_template_directory_uri().'/js/retina-1.1.0.min.js','jquery'); wp_enqueue_style('acation_stylesheet', get_stylesheet_uri(), false, '1.0.1', 'all'); wp_enqueue_style('acation_font_css', get_template_directory_uri().'/fonts/stylesheet.css',false,false); wp_enqueue_style('acation_genericons_css', get_template_directory_uri().'/genericons/genericons.css',false,false); wp_enqueue_style('acation_prettyPhoto_css', get_template_directory_uri().'/css/prettyPhoto.css',false,false); wp_enqueue_style('acation_flexslider_css', get_template_directory_uri().'/css/flexslider.css',false,false); } add_action('wp_enqueue_scripts', 'acation_enqueue_scripts'); /* Initial Masonry */ function acation_masonry_init() { global $acation_options; wp_reset_query(); if(!is_page() && !is_single()): ?> '; } if(trim($output) != "") $output = '
'; return $output; } } /* Add PrettyPhoto initial script */ function acation_prettyphoto_init() { ?> ]*).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>(.*?)<\/a>/i"; $replacement = '$7'; $content = preg_replace($pattern, $replacement, $content); return $content; } add_filter('the_content','acation_prettyphoto_rel'); /* Get first image for image post type */ function acation_first_image($link = true, $class = 'entry-featured') { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('//i', $post->post_content, $matches); $first_img = $matches[1][0]; if(empty($first_img)) { $first_img = ""; } else { if($link) $first_img = '
'; else $first_img = '
'; } return $first_img; } /* Display featured image */ function acation_featured_image($size = 'full', $link = true, $class = 'entry-featured') { if(has_post_thumbnail()) { $image = get_the_post_thumbnail(get_the_ID(),$size); if(trim($image) != "") { if($link) echo ''; else echo '
'.$image.'
'; } } } /* Print attached image with a link to next attached image */ function acation_the_attached_image() { $post = get_post(); $attachment_size = apply_filters('acation_attachment_size', array(810, 810)); $next_attachment_url = wp_get_attachment_url(); $attachment_ids = get_posts(array( 'post_parent' => $post->post_parent, 'fields' => 'ids', 'numberposts' => -1, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', )); if(count($attachment_ids) > 1) { foreach($attachment_ids as $attachment_id) { if($attachment_id == $post->ID) { $next_id = current($attachment_ids); break; } } if($next_id) { $next_attachment_url = get_attachment_link($next_id); } else { $next_attachment_url = get_attachment_link(array_shift($attachment_ids)); } } $exp = "/^https?:\/\/(.)*\.(jpg|png|gif|ico)$/i"; if(!preg_match($exp,$next_attachment_url)) $rel = "attachment"; else $rel = "prettyPhoto"; printf('%3$s', esc_url($next_attachment_url), $rel, wp_get_attachment_image($post->ID, $attachment_size)); } /* Content class based on existence of sidebar */ function acation_content_class($classname = 'fullwidth') { global $acation_options; $output = 'mesh-col-'.$acation_options['mesh_columns']; if(!is_active_sidebar('sidebar-1')) $output .= ' '.$classname; elseif(is_404() || is_page_template("page-fullwidth.php")) $output .= ' '.$classname; elseif((is_home() || is_archive()) && !$acation_options['show_home_sidebar']) { $output .= ' '.$classname; } echo ' class="'.$output.'"'; } /* Footer credit */ function acation_footer_credit() { $output = ''; $output .= __('Theme by Luxury7'); echo $output; } /* Prints HTML with meta information for current post-date and author. Create your own acation_posted_on to override in a child theme */ function acation_posted_on($dateformat = 'M j, Y', $date_label = '', $author_label = '') { echo ''; } /* Sets the post excerpt length to 50 words. To override this length in a child theme, remove the filter and add your own function tied to the excerpt_length filter hook. */ function acation_excerpt_length($length) { return 50; } add_filter('excerpt_length', 'acation_excerpt_length'); /* Returns a "read more" link for excerpts */ function acation_continue_reading_link() { return ''.__('Read more...','acation').''; } /* Replaces "[...]" (appended to automatically generated excerpts) with a acation_continue_reading_link(). To override this in a child theme, remove the filter and add your own function tied to the excerpt_more filter hook. */ function acation_auto_excerpt_more($more) { return acation_continue_reading_link(); } add_filter('excerpt_more', 'acation_auto_excerpt_more'); /* Adds a "continue reading" link to custom post excerpts. To override this link in a child theme, remove the filter and add your own function tied to the get_the_excerpt filter hook. */ function acation_custom_excerpt_more( $output ) { if(has_excerpt() && !is_attachment()) { $output .= acation_continue_reading_link(); } return $output; } add_filter('get_the_excerpt', 'acation_custom_excerpt_more'); /* Post categories and tags list */ function acation_utility_list($container = true, $show_categories = true, $show_tags = true, $show_label = true, $category_label = "", $tag_label = "", $sep = ", ") { global $acation_options; $show_categories = $acation_options['show_categories']; $show_tags = $acation_options['show_tags']; $output = ""; $categories_list = ""; $tag_list = ""; if($show_categories) $categories_list = get_the_category_list($sep); if($show_tags) { if($show_label) $tag_list = get_the_tag_list(''); else $tag_list = get_the_tag_list(''); } if($categories_list != "") { if($show_label) $categories_list = ''.$category_label.$categories_list.''; else $categories_list = ''.$categories_list.''; } $output .= $categories_list.$tag_list; if($container and $output != "") $output = '
'.$output.'
'."\n"; echo $output; } /* Create paged navigation for posts */ function acation_pagination($range = 4){ global $paged, $wp_query; $max_page = 0; if (!$max_page) { $max_page = $wp_query->max_num_pages; } if($max_page > 1){ echo ''."\n"; } } /* Display navigation to next/previous post when applicable */ function acation_post_nav(){ global $acation_options; /* Do not print empty markup if there is nowhere to navigate. */ $previous =(is_attachment())? get_post(get_post()->post_parent): get_adjacent_post(false, '', true); $next = get_adjacent_post(false, '', false); if((!$next && !$previous) || !$acation_options['show_post_nav']){ return; } ?> array("name" => "feed", "profile_url" => get_bloginfo('rss2_url'), "icon" => "feed"), ); $output = ''; foreach($social as $entry) { $output .= ''; } echo $output; } /* Display post comments link */ function acation_comments_link($comments_label = true) { if(comments_open() && !post_password_required()) { if($comments_label) comments_popup_link(__('0 comments', 'acation'), __('1 comment', 'acation'), __('% comments', 'acation'), 'entry-comments'); else comments_popup_link(__('0', 'acation'), __('1', 'acation'), __('%', 'acation'), 'entry-comments'); } } /* Callback for comments */ function acation_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); switch($comment->comment_type): case 'pingback': case 'trackback': ?>
  • id="comment-">
  • >
    '', 'reply_text' => __('Reply', 'acation'), 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
    comment_approved == '0'): ?>

    ID); foreach($meta as $val) { foreach($val as $entry) { if(preg_match('/'.$entry.''; } } } } /* Extract audio from content */ function acation_post_audio() { global $post; $audio_list = ""; $audio_arr = array(); if(preg_match_all('/href=\"(.*?)\.mp3\"/i',$post->post_content, $matches)) { $audio_arr = $matches[1]; $audio_list .= ''; } $ie_audio_list = ''; if(preg_match_all('/href=\"(.*?)\.mp3\">(.*?)<\/a>/i',$post->post_content, $matches)) { $audio_arr = $matches[0]; foreach($audio_arr as $entry) { $ie_audio_list .= '

    '; } } if($audio_list != "" || $ie_audio_list != "") return '

    '.$audio_list.$ie_audio_list.'
    '; } /* Extract quotes */ function acation_post_quote() { global $post; $quote_list = ""; $quote_arr = array(); if(preg_match_all("/
    (.*?)<\/blockquote>/s",$post->post_content, $matches)) { $quote_arr = $matches[0]; foreach($quote_arr as $entry) { $quote_list .= $entry; } } return $quote_list; } /* Trim words function */ function acation_trim_text($input, $length = 50, $ellipses = true, $strip_html = true) { if($strip_html) { $input = strip_tags($input); } if(strlen($input) <= $length) { return $input; } $last_space = strrpos(substr($input, 0, $length), ' '); $trimmed_text = substr($input, 0, $last_space); if($ellipses) { $trimmed_text .= '...'; } return $trimmed_text; } ?>