array( 'url' => '%s/images/top-default1.jpg', 'thumbnail_url' => '%s/images/top-default1-thumb.jpg', 'description' => __( 'Default', 'allmed' ) ))); add_editor_style('custom-editor-style.css'); if ( ! defined( 'ALLMED_COLOR_LINK' ) ) define( 'ALLMED_COLOR_LINK', '#eab910' ); if ( ! defined( 'ALLMED_COLOR_H' ) ) define( 'ALLMED_COLOR_H', '#eab910' ); if ( ! defined( 'ALLMED_COLOR_TEXT' ) ) define( 'ALLMED_COLOR_TEXT', '#000000' ); if ( ! defined( 'ALLMED_EXCERPT_BACKGROUND' ) ) define( 'ALLMED_EXCERPT_BACKGROUND', '#ebebee' ); if ( ! defined( 'ALLMED_EXCERPT_BORDER' ) ) define( 'ALLMED_EXCERPT_BORDER', '#506774' ); if ( ! defined( 'ALLMED_WIDGET_BACKGROUND' ) ) define( 'ALLMED_WIDGET_BACKGROUND', '#ebebee' ); if ( ! defined( 'ALLMED_WIDGET_TITLE_BACKGROUND' ) ) define( 'ALLMED_WIDGET_TITLE_BACKGROUND', '#506774' ); if ( ! defined( 'ALLMED_FOOTER_BACKGROUND' ) ) define( 'ALLMED_FOOTER_BACKGROUND', '#506774' ); if ( ! defined( 'ALLMED_FOOTER_COLOR' ) ) define( 'ALLMED_FOOTER_COLOR', '#FFFFFF' ); if ( ! defined( 'ALLMED_WRAPPER_BACKGROUND' ) ) define( 'ALLMED_WRAPPER_BACKGROUND', '#FFFFFF' ); if ( ! defined( 'ALLMED_SINGLE_BACKGROUND' ) ) define( 'ALLMED_SINGLE_BACKGROUND', '#ebebee' ); if ( ! defined( 'ALLMED_SUBMIT_BACKGROUND' ) ) define( 'ALLMED_SUBMIT_BACKGROUND', '#ebebee' ); if ( ! defined( 'ALLMED_LINE_COLOR' ) ) define( 'ALLMED_LINE_COLOR', '#ebebee' ); if ( ! defined( 'ALLMED_MENU_BACKGROUND' ) ) define( 'ALLMED_MENU_BACKGROUND', '#ebebee' ); if ( ! defined( 'ALLMED_WIDGET_H' ) ) define( 'ALLMED_WIDGET_H', '#ffffff' ); if ( ! defined( 'ALLMED_ENTRY_LINK' ) ) define( 'ALLMED_ENTRY_LINK', '#eab910' ); if ( ! defined( 'ALLMED_ENTRY_TEXT' ) ) define( 'ALLMED_ENTRY_TEXT', '#000000' ); if ( ! defined( 'ALLMED_COLOR_STICKY' ) ) define( 'ALLMED_COLOR_STICKY', '#7af0b5' ); add_theme_support( 'post-formats', array( 'image', 'audio', 'video' ) ); } } add_theme_support( 'post-thumbnails' ); if ( ! function_exists( 'allmed_get_option' ) ) : function allmed_get_option($Aoption_name, $default = null) { return stripslashes(get_option($Aoption_name, $default)); }; endif; function register_main_menus() { register_nav_menus( array( 'primary-menu' => __( 'Primary Menu' ) ) ); } if (function_exists('register_nav_menus')) add_action( 'init', 'register_main_menus' ); if ( ! function_exists( 'allm_get_the_author_posts_link' ) ){ function allm_get_the_author_posts_link(){ global $authordata, $themename; $link = sprintf( '', get_author_posts_url( $authordata->ID, $authordata->user_nicename ), esc_attr( sprintf( __( 'Posts by %s', $themename ), get_the_author() ) ), get_the_author() ); return apply_filters( 'the_author_posts_link', $link ); } } function allm_short_title($char) { $title = get_the_title($post->ID); $title = substr($title,0,$char); echo $title; } if ( ! function_exists( 'allm_postinfo_meta' ) ){ function allm_postinfo_meta( $postinfo, $date_format, $comment_zero, $comment_one, $comment_more ){ global $themename; $postinfo_meta = ''; if ( in_array( 'author', $postinfo ) ){ $postinfo_meta .= ' ' . esc_html__('By',$themename) . ' ' . allm_get_the_author_posts_link(); } if ( in_array( 'date', $postinfo ) ) $postinfo_meta .= ' ' . esc_html__('Date:',$themename) . ' ' . get_the_time( $date_format ); if ( in_array( 'categories', $postinfo ) ) $postinfo_meta .= ' ' . esc_html__('in',$themename) . ' ' . get_the_category_list(', '); if ( in_array( 'comments', $postinfo ) ) $postinfo_meta .= ' | ' . allm_get_comments_popup_link( $comment_zero, $comment_one, $comment_more ); echo $postinfo_meta; } } if ( ! function_exists( 'allm_get_comments_popup_link' ) ){ function allm_get_comments_popup_link( $zero = false, $one = false, $more = false ){ global $themename; $id = get_the_ID(); $number = get_comments_number( $id ); if ( 0 == $number && !comments_open() && !pings_open() ) return; if ( $number > 1 ) $output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments', $themename) : $more); elseif ( $number == 0 ) $output = ( false === $zero ) ? __('No Comments',$themename) : $zero; else // must be one $output = ( false === $one ) ? __('1 Comment', $themename) : $one; return '' . '' . apply_filters('comments_number', $output, $number) . '' . ''; } } add_action('wp_head', 'allmed_head'); if ( ! function_exists( 'allmed_head' ) ) : function allmed_head() { if (!is_admin()) { global $allmed_favicon_url; ?>
$value ) { if( isset( $allmed_options[$key] ) ) { $output[$key] = strip_tags( stripslashes( $allmed_options[ $key ] ) ); } } return apply_filters( 'allmed_options_validate', $output, $allmed_options ); } endif; if ( ! function_exists( 'allmed_general_options_input' ) ) : function allmed_general_options_input() { register_setting('allmed_general_options_page','allmed_general_options_page','allmed_options_validate'); } endif; add_action( 'admin_init', 'allmed_general_options_input' ); if ( ! function_exists( 'allmed_options_admin_menu' ) ) : function allmed_options_admin_menu() { $allmed_theme_page = add_theme_page(__("Allmed Options", 'allmed'), __("Allmed Options", 'allmed'), 'edit_theme_options', 'allmed_general_options_page', 'allmed_general_options_page'); if(!$allmed_theme_page) return; add_action('admin_print_styles-' . $allmed_theme_page, 'allmed_ilc_farbtastic_script'); }; endif; add_action('admin_menu', 'allmed_options_admin_menu'); if ( ! function_exists( 'allmed_ilc_farbtastic_script' ) ) : function allmed_ilc_farbtastic_script( $hook_suffix ) { wp_enqueue_style( 'farbtastic' ); wp_enqueue_script( 'farbtastic' ); }; endif; if ( ! function_exists( 'allmed_general_options_page' ) ) : function allmed_general_options_page() { global $_POST, $allmed_favicon_url; if ( $_POST['update_options'] == 'true' ) { options_update(); };?>


Upload your favicon using WordPress Media Library and insert its URL here', 'allmed'), home_url().'/wp-admin/media-new.php'); ?>

  • - ID, '_et_allmed_audio_mp3_url', true ); $allm_audiolink_ogg = get_post_meta( $post->ID, '_et_allmed_audio_ogg_url', true ); $themepath = get_template_directory_uri(); ++$allm_jplayer_instances_on_page; ?>
    " class="jp-jplayer">
    " class="jp-audio">
    " > '' && get_option('allmed_integrate_singletop_enable') == 'on') echo(get_option('allmed_integration_single_top')); ?>

    '; ?>';?>

    ID, '_et_allmed_video_url', true); $video = $wp_embed->shortcode( '', $video ); $video = preg_replace('//','',$video); $video = preg_replace("/width=\"[0-9]*\"/", "width={$video_width}", $video); $video = preg_replace("/height=\"[0-9]*\"/", "height={$video_height}", $video); echo $video; ?>
    :
    '

    '.esc_attr__('Pages','allmed').': ', 'after' => '

    ', 'next_or_number' => 'number')); ?> ←Older post')) ?>     →')) ?>
    '; if ( $bgcolor <> '' ) $style .= 'body { background-color: #' . esc_attr($bgcolor) . '; }'; if ( $bgtexture_url <> '' ) $style .= 'body { background-image: url(' . esc_attr($bgtexture_url) . '); }'; if ( $bgimage_url <> '' ) $style .= 'body { background-image: url(' . esc_attr($bgimage_url) . '); background-position: top center; background-repeat: no-repeat; }'; $style .= ''; if ( $bgcolor <> '' || $bgtexture_url <> '' || $bgimage_url <> '' ) echo $style; } /** * Shortcode for photo gallery */ add_shortcode('photart', 'photart_shortcode'); function photart_shortcode($attr) { global $post, $wp_locale; static $instance = 0; $instance++; if ( isset( $attr['orderby'] ) ) { $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); if ( !$attr['orderby'] ) unset( $attr['orderby'] ); } extract(shortcode_atts(array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'include' => '', 'exclude' => '' ), $attr)); $id = intval($id); if ( 'RAND' == $order ) $orderby = 'none'; if ( !empty($include) ) { $include = preg_replace( '/[^0-9,]+/', '', $include ); $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = array(); foreach ( $_attachments as $key => $val ) { $attachments[$val->ID] = $_attachments[$key]; } } elseif ( !empty($exclude) ) { $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } else { $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } if ( empty($attachments) ) return ''; if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $att_id => $attachment ) $output .= wp_get_attachment_link($att_id, $size, true) . "\n"; return $output; } $output = apply_filters('gallery_style', ""); $i = 0; foreach ( $attachments as $id => $attachment ) { $link = wp_get_attachment_image($id, 'full', false); $output .= "
  • "; $output .= "$link"; if ( ($attachment->post_excerpt) || ($attachment->post_content) ) { $output .= "

    ".wptexturize($attachment->post_excerpt); $output .= "".wptexturize($attachment->post_content)."

    "; } $output .= "
  • "; } return $output; } /** * Take all images from post */ function catch_all_images() { global $post, $posts; ob_start(); ob_end_clean(); $output = preg_match_all('//i', $post->post_content, $matches); foreach ($matches[1] as $value) { ?>
  • $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order')); if ( ! is_array($attachments) ) continue; $count = count($attachments); $first_attachment = array_shift($attachments); $temp_img = wp_get_attachment_image_src($first_attachment->ID,'full'); $first_img = $temp_img[0]; if(empty($first_img)){ //Defines a default image $first_img = bloginfo('template_directory')."/img/default.jpg"; } return $first_img; } function slide($atts, $content = null) { do_shortcode( $content ); extract(shortcode_atts(array( "title" => '' ), $atts)); return '

    '.$title.'

    '.do_shortcode( $content ).'
    '; } add_shortcode('slide', 'slide'); ?>