__( 'Primary Sidebar', 'expediawp' ), 'id' => 'primary-widget-area', 'description' => __( 'The primary widget area', 'expediawp' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Area 2, located at the top right of the layout. Empty by default. register_sidebar( array( 'name' => __( 'Seconday Sidebar', 'expediawp' ), 'id' => 'right-primary-widget-area', 'description' => __( 'This sidebar only displays in the three column layout set up.', 'expediawp' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } /** Register sidebars by running expediawp_widgets_init() on the widgets_init hook. */ add_action( 'widgets_init', 'expediawp_widgets_init' ); // Set sepcial widget to display customized data in sidebars. class List_Content extends WP_Widget { function List_Content() { $widget_options = array('description' => 'This widget displays latest content with thumbnails from a selected category.', 'classname' => 'widget-listing'); parent::WP_Widget(false, 'TB Theme Latest Content', $widget_options); } function form($instance) { // outputs the options form on admin $instance = wp_parse_args((array) $instance, array('title' => __('', 'widget-listing'), 'cat_name' => 'Uncategorized', 'n_posts' => 5)); $title = esc_attr($instance['title']); $cat_name = esc_attr($instance['cat_name']); $n_posts = intval($instance['n_posts']); $categories = &get_categories('type=post&orderby=name&hide_empty=0'); ?>


    'This widget displays featured content with thumbnails.', 'classname' => 'widget-listing'); parent::WP_Widget(false, 'TB Theme Featured Content', $widget_options); } function form($instance) { // outputs the options form on admin $instance = wp_parse_args((array) $instance, array('title' => __('', 'widget-listing'), 'cat_name' => 'exp_widget_feature', 'n_posts' => 5)); $title = esc_attr($instance['title']); $cat_name = esc_attr($instance['cat_name']); $n_posts = intval($instance['n_posts']); ?>

    'Displays multiple map points from Posts where you have inserted locations.', 'classname' => 'widget-google-maps'); parent::WP_Widget(false, 'TB Global Google Map', $widget_options); } function form($instance) { // outputs the options form on admin $instance = wp_parse_args((array) $instance, array('title' => __('My Map Locations', 'widget-links'),'height' => __('300', 'widget-links'),'loc_limit' => __('20', 'widget-links')) ); $title = esc_attr($instance['title']); $height = esc_attr($instance['height']); $loc_limit = intval($instance['loc_limit']); ?>

    jQuery(document).ready( function() { load("'.get_template_directory_uri().'/scripts/gmaps_ajax.php?limit='.$limit.'","'.$instance.'"); }); '; $gmap .= '

    '.$title.'

    '; $gmap.= '
    '; if($width) $width = 'width:'.$width.'px; '; $gmap .= '
    '; $gmap .= '
    '; return $gmap; } // Displays google maps in posts function exp_google_maps_post($width='',$height='325',$instance='map_canvas') { global $post; $location = get_post_meta($post->ID,'exp_post_geo_address',true); if($location && is_single()) { $gmap = ''; $gmap.= '
    '; if($width) $width = 'width:'.$width.'px; '; $gmap .= '
    '; $gmap .= '
    '; return $gmap; } } // Google maps shortcode function geo_address_post_func( $atts,$content=null ) { extract( shortcode_atts( array( 'height' => '325', 'width' => '' ), $atts ) ); return exp_google_maps_post($width,$height,'map_shortcode'); } add_shortcode( 'tb_google_map', 'geo_address_post_func' );