'.get_bloginfo('name').'.'
.' Powered by WordPress.';
require_once(get_template_directory() . '/custom_functions.php');
require_once(get_template_directory() . '/includes/functions/comments.php');
load_theme_textdomain( 'allmed', get_template_directory() . '/languages' );
require_once(get_template_directory() . '/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);
add_theme_support( 'custom-background' );
add_theme_support( 'automatic-feed-links' );
}
add_action( 'after_setup_theme', 'allm_setup_theme' );
function allmed_widget_init() {
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
));
register_sidebar(array(
'name' => 'Footer',
'before_widget' => ' ',
'before_title' => '',
));
}
add_action( 'widgets_init', 'allmed_widget_init' );
function allmed_get_option($Aoption_name, $default = null)
{
return stripslashes(get_option($Aoption_name, $default));
};
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' );
add_filter('the_content', 'my_fancyboxrel');
function my_fancyboxrel($content) {
global $post;
$pattern ="//i";
$replacement = '';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
function allm_get_the_author_posts_link(){
global $authordata;
$link = sprintf(
'%3$s',
get_author_posts_url( $authordata->ID, $authordata->user_nicename ),
esc_attr( sprintf( __( 'Posts by %s', 'allmed' ), get_the_author() ) ),
get_the_author()
);
return apply_filters( 'the_author_posts_link', $link );
}
function allm_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() )
return $title;
// Add the site name.
$title .= get_bloginfo( 'name' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title = "$title $sep $site_description";
// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 )
$title = "$title $sep " . sprintf( __( 'Page %s', 'allmed' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'allm_wp_title', 10, 2 );
function allm_short_title($char) {
global $post;
$title = get_the_title($post->ID);
$title = substr($title,0,$char);
echo $title;
}
function allm_postinfo_meta( $postinfo, $date_format, $comment_zero, $comment_one, $comment_more ){
$postinfo_meta = '';
if ( in_array( 'author', $postinfo ) ){
$postinfo_meta .= ' ' . esc_html__('By','allmed') . ' ' . allm_get_the_author_posts_link();
}
if ( in_array( 'date', $postinfo ) )
$postinfo_meta .= ' ' . esc_html__('Date:','allmed') . ' ' . get_the_time( $date_format );
if ( in_array( 'categories', $postinfo ) )
$postinfo_meta .= ' ' . esc_html__('in','allmed') . ' ' . 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;
}
function allm_get_comments_popup_link( $zero = false, $one = false, $more = false ){
$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', 'allmed') : $more);
elseif ( $number == 0 )
$output = ( false === $zero ) ? __('No Comments','allmed') : $zero;
else // must be one
$output = ( false === $one ) ? __('1 Comment', 'allmed') : $one;
return '';
}
add_action('wp_head', '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 );
}
function allmed_general_options_input() {
register_setting('allmed_general_options_page','allmed_general_options_page','allmed_options_validate');
}
add_action( 'admin_init', 'allmed_general_options_input' );
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');
};
add_action('admin_menu', 'allmed_options_admin_menu');
function allmed_ilc_farbtastic_script( $hook_suffix )
{
wp_enqueue_style( 'farbtastic' );
wp_enqueue_script( 'farbtastic' );
};
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(); };?>