'.get_bloginfo('name').'.'
.' Powered by WordPress .';
require_once(TEMPLATEPATH . '/custom_functions.php');
require_once(TEMPLATEPATH . '/includes/functions/comments.php');
load_theme_textdomain( $themename, get_template_directory() . '/languages' );
require_once(TEMPLATEPATH . '/includes/additional_functions.php');
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' );
add_theme_support( 'post-formats', array( 'image', 'audio', 'video' ) );
}
}
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size(270, 180, true);
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
));
register_sidebar(array(
'name' => 'Footer',
'before_widget' => ' ',
'before_title' => '',
));
};
if ( ! function_exists( 'allmed_get_option' ) ) :
function allmed_get_option($Aoption_name, $default = null)
{
return stripslashes(get_option($Aoption_name, $default));
};
endif;
function allm_register_main_menus() {
register_nav_menus(
array(
'primary-menu' => __( 'Primary Menu', 'allmed' )
)
);
}
if (function_exists('register_nav_menus')) add_action( 'init', 'allm_register_main_menus' );
if ( ! function_exists( 'allm_get_the_author_posts_link' ) ){
function allm_get_the_author_posts_link(){
global $authordata, $themename;
$link = sprintf(
'%3$s ',
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) {
global $post;
$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 '';
}
}
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, $allm_footer_text;
if ( isset($_POST['update_options']) && $_POST['update_options'] == 'true' ) { allm_options_update(); };?>
";
$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 allm_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 allm_slide($atts, $content = null) {
do_shortcode( $content );
extract(shortcode_atts(array(
"title" => ''
), $atts));
return '
'.do_shortcode( $content ).'
';
}
add_shortcode('allm_slide', 'allm_slide');
?>