'.$editbutton,
'after_widget' => '',
'before_title' => '
'
));
register_sidebar(array(
'name' => __('Frontpage Widgets', 'optimizer'),
'id' => 'front_sidebar',
'description' => __('With Optmizer Free you can only add 6 widgets to this Area. Upgrade to PRO to add unlimited Widgets.', 'optimizer'),
'before_widget' => '
',
'before_title' => '
'
));
}
add_action( 'widgets_init', 'optimizer_widgets_init' );
//Default Placeholder Image
if(!function_exists( 'optimizer_placeholder_image' ) ){
function optimizer_placeholder_image(){
return ''. get_template_directory_uri().'/assets/images/blank_img.png';
}
}
//Assign Thumbnail to post if it has gallery
function optimizer_gallery_thumb(){
global $post;
// Make sure the post has a gallery in it
if( has_shortcode( $post->post_content, 'gallery' ) ){
$gallery = get_post_gallery( get_the_ID(), false );
$ids = explode( ",", $gallery['ids'] );
foreach( $ids as $id ) {
$imgurl = wp_get_attachment_image_src( $id, array(400,270) );
}
$first_thumb = $imgurl[0];
return $first_thumb;
}
}
// force the link='file' gallery shortcode attribute:
add_filter('shortcode_atts_gallery','optimizer_overwrite_gallery_atts',10,3);
function optimizer_overwrite_gallery_atts($out, $pairs, $atts){
global $optimizer;
if(!empty($optimizer['post_gallery_id']))
$out['link']='file';
return $out;
}
//Display Read More Button in Layout4
function optimizer_excerpt_more($more) {
return '
'.__('+ Read More', 'optimizer').'';
}
add_filter('excerpt_more', 'optimizer_excerpt_more');
//Alter the Read More Link
add_filter( 'the_content_more_link', 'optimizer_more_link', 10, 2 );
function optimizer_more_link( $more_link, $more_link_text ) {
return str_replace( $more_link_text, __('+ Read More', 'optimizer'), $more_link );
}
//optimizer CUSTOM Search Form
function optimizer_search_form( $form ) {
$form = '
';
return $form;
}
add_filter( 'get_search_form', 'optimizer_search_form' );
//**************Toptimizer COMMENTS******************//
if(!function_exists( 'optimizer_comment' ) ){
function optimizer_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
id="li-comment-">
id="li-comment-">
';
$fields['email'] = '';
$fields['url'] = ' ';
return $fields;
}
add_filter('comment_form_default_fields','optimizer_comment_form_fields');