';
the_widget('WP_Widget_Search', $instance, $rightargs);
$rightargs['before_widget'] = '
';
$instance['display_featured_image']=1;
$instance['title']='Recent Posts';
$instance['display_title']=1;
$instance['excerpt_length']=120;
the_widget('Posts', $instance, $rightargs);
$rightargs['before_widget'] = '
])*>( )?<\/p>/', '', $truncate); if ($echo) return print $truncate; else return $truncate; } return; } function smt_menu($a) { $a=preg_replace("/
/", "", $a);
$a=preg_replace('/
/', "
- class="current_page_item">_( 'homelink' );?>
';
echo '';
if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
if ($menu_items = wp_get_nav_menu_items($menu->term_id)) {
$sub=array();
foreach ($menu_items as $key => $menu_item ) {
if ($menu_item->menu_item_parent==0) $sub[$menu_item->ID]=''; else $sub[$menu_item->ID]=$sub[$menu_item->menu_item_parent].'- ';
echo '';
}
} else {
$func='block_'.preg_replace('/-/', '_', $menu_name).'_mobile';
if (is_callable($func)) {
$func();
}
}
} else {
$func='block_'.preg_replace('/-/', '_', $menu_name).'_mobile';
if (is_callable($func)) {
$func();
}
}
echo '';
}
function addGMap($atts, $content = null) {
extract(shortcode_atts(array( "addr" => '', "mzoom" => '16' ), $atts));
$id='map_canvas'.mktime().rand(0,1000);
return "
";
}
add_shortcode('gmap', 'addGMap');
function addYouTube($atts, $content = null) {
extract(shortcode_atts(array( "id" => '' ), $atts));
return '
'; } add_shortcode('youtube', 'addYouTube'); function addVimeo($atts, $content = null) { extract(shortcode_atts(array( "id" => '' ), $atts)); $videoinf = unserialize(file_get_contents("http://vimeo.com/api/v2/video/".$id.".php")); return '
'; } add_shortcode('vimeo', 'addVimeo'); function addTooltips($atts, $content = "") { extract(shortcode_atts(array( "tiptext" => '' ), $atts)); return ''.$content.''.$tiptext.''; } add_shortcode('tooltip', 'addTooltips'); function add_smpanel() { if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) return; if ( get_user_option('rich_editing') == 'true') { add_filter('mce_external_plugins', 'add_smpanel_tinymce_plugin'); add_filter('mce_buttons_3', 'register_smpanel'); } } add_action('init', 'add_smpanel'); function register_smpanel($buttons) { array_push($buttons, "youtube","vimeo","|","btns","cols","tooltips","highlights", "gmap"); return $buttons; } function add_smpanel_tinymce_plugin($plugin_array) { $plugin_array['smpanel'] = get_template_directory_uri() .'/js/editor_plugin.js'; return $plugin_array; } function my_refresh_mce($ver) { $ver += 3; return $ver; } add_editor_style( 'css/editor.css' ); add_filter( 'tiny_mce_version', 'my_refresh_mce'); if ( ! function_exists('tdav_css') ) { function tdav_css($wp) { $wp .= ','.get_template_directory_uri().'/css/shortcode.css '; return $wp; } } add_filter( 'mce_css', 'tdav_css' ); function smtheme_topic_count_text($count) { global $SMTheme; return sprintf( _n($SMTheme->_( 'altposts' ), $SMTheme->_( 'altpostss' ), $count), number_format_i18n( $count ) ); } function smtheme_tag_cloud() { $args['topic_count_text_callback']='smtheme_topic_count_text'; return $args; } add_filter('widget_tag_cloud_args', 'smtheme_tag_cloud'); add_filter( 'gettext', 'theme_change_comment_field_names', 20, 3 ); /** * Change comment form default field names. * * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext */ function theme_change_comment_field_names( $translated_text, $text, $domain ) { global $SMTheme; switch ( $translated_text ) { case 'View all posts filed under %s' : $translated_text = $SMTheme->_( 'altcats' ); break; } return $translated_text; } add_action('admin_init', 'single_content_layout', 1); function single_content_layout() { add_meta_box( 'single_content_layout', 'Content layout', 'single_content_layout_func', 'post', 'side', 'high' ); add_meta_box( 'single_content_layout', 'Content layout', 'single_content_layout_func', 'page', 'side', 'high' ); } function single_content_layout_func($post) { global $APage; $layouts=$APage->PageOptions['layout']['content']['pagelayout']['params']; $selected = get_post_meta($post->ID, 'single_layout', 1); ?>
", $a);
$a=preg_replace("/<\/ul>/", "
", $a); return $a; } add_filter('wp_list_categories', 'smt_menu'); add_filter('wp_list_pages', 'smt_menu'); add_filter('wp_nav_menu_items', 'smt_menu'); function block_main_menu() { global $SMTheme; ?>