Exemplo n.º 1
0
function tie_set_demo_data()
{
    $theme_options = get_option('tie_options');
    $cat1 = $cat2 = $cat3 = $cat4 = $cat5 = 1;
    $cat1 = get_cat_ID('Business');
    $cat2 = get_cat_ID('Sports');
    $cat3 = get_cat_ID('Technology');
    $cat4 = get_cat_ID('Videos');
    $cat5 = get_cat_ID('World');
    $home_cats = array(array('title' => 'Recent Posts', 'number' => 3, 'display' => 'default', 'pagi' => 'n', 'boxid' => 'recent_1777', 'type' => 'recent'), array('id' => $cat4, 'order' => 'latest', 'number' => 5, 'style' => '2c', 'type' => 'n'), array('id' => $cat3, 'order' => 'latest', 'number' => 5, 'style' => '2c', 'type' => 'n'), array('id' => $cat5, 'title' => 'Scrolling Box', 'number' => 8, 'boxid' => 's_11140', 'type' => 's'), array('text' => '<a href="#" title="">
				<img src="http://themes.tielabs.com/data/banners/tf_468x60_v1.gif" alt="">
			</a>', 'type' => 'ads'), array('id' => $cat1, 'title' => 'News In Picture', 'boxid' => 'news-pic_1775', 'type' => 'news-pic', 'style' => 'default'), array('id' => $cat2, 'order' => 'latest', 'number' => 5, 'style' => '1c', 'type' => 'n'), array('id' => $cat5, 'order' => 'latest', 'number' => 5, 'style' => 'li', 'type' => 'n'), array('id' => $cat1, 'title' => 'Grid', 'boxid' => 'news-pic_11099', 'type' => 'news-pic', 'style' => 'row'));
    $theme_options['social']['facebook'] = 'https://www.facebook.com/TieLabs';
    $theme_options['social']['twitter'] = 'https://twitter.com/mo3aser';
    $theme_options['social']['dribbble'] = 'http://dribbble.com/mo3aser';
    $theme_options['social']['foursquare'] = 'https://foursquare.com/mo3aser';
    $theme_options['social']['Pinterest'] = 'http://www.pinterest.com/mo3aser/';
    $theme_options['social']['instagram'] = 'http://instagram.com/imo3aser';
    $theme_options['on_home'] = 'boxes';
    $theme_options['footer_widgets'] = 'footer-4c';
    $theme_options['slider_type'] = 'flexi';
    $theme_options['slider_cat'] = array($cat1, $cat2, $cat3, $cat4, $cat5);
    $theme_options['banner_top'] = $theme_options['banner_bottom'] = true;
    $theme_options['banner_top_img'] = $theme_options['banner_bottom_img'] = 'http://themes.tielabs.com/data/banners/sahifa-728.jpg';
    $theme_options['banner_top_url'] = $theme_options['banner_bottom_url'] = 'http://themeforest.net/item/sahifa-responsive-wordpress-newsmagazineblog/2819356?ref=mo3aser';
    update_option('tie_home_cats', $home_cats);
    update_option('tie_options', $theme_options);
    //Import Menus
    $top_menu = get_term_by('name', 'top', 'nav_menu');
    $main_menu = get_term_by('name', 'main', 'nav_menu');
    set_theme_mod('nav_menu_locations', array('top-menu' => $top_menu->term_id, 'primary' => $main_menu->term_id));
    //Import Widgets
    update_option('sidebars_widgets', '');
    tie_addWidgetToSidebar('primary-widget-area', 'counter-widget', 0, array('facebook' => 'https://www.facebook.com/TieLabs', 'youtube' => 'http://www.youtube.com/user/TEAMMESAI', 'vimeo' => 'http://vimeo.com/channels/kidproof'));
    tie_addWidgetToSidebar('primary-widget-area', 'widget_tabs', 0);
    tie_addWidgetToSidebar('primary-widget-area', 'facebook-widget', 0, array('title' => 'Find us on Facebook', 'page_url' => 'https://www.facebook.com/TieLabs'));
    tie_addWidgetToSidebar('primary-widget-area', 'social', 0, array('title' => 'Social', 'tran_bg' => true, 'icons_size' => 32));
    tie_addWidgetToSidebar('primary-widget-area', 'youtube-widget', 0, array('title' => 'Subscribe to our Channel', 'page_url' => 'TEAMMESAI'));
    tie_addWidgetToSidebar('primary-widget-area', 'video-widget', 0, array('title' => ' Featured Video', 'youtube_video' => 'UjXi6X-moxE'));
    tie_addWidgetToSidebar('primary-widget-area', 'login-widget', 0, array('title' => ' Login'));
    tie_addWidgetToSidebar('first-footer-widget-area', 'posts-list-widget', 0, array('title' => 'Popular Posts', 'no_of_posts' => 5, 'thumb' => true, 'posts_order' => 'popular'));
    tie_addWidgetToSidebar('second-footer-widget-area', 'posts-list-widget', 0, array('title' => 'Random Posts', 'no_of_posts' => 5, 'thumb' => true, 'posts_order' => 'random'));
    tie_addWidgetToSidebar('third-footer-widget-area', 'posts-list-widget', 0, array('title' => 'Latest Posts', 'no_of_posts' => 5, 'thumb' => true, 'posts_order' => 'latest'));
    tie_addWidgetToSidebar('fourth-footer-widget-area', 'comments_avatar-widget', 0, array('title' => 'Recent Comments', 'thumb' => true, 'no_of_comments' => 5, 'avatar_size' => 50));
}
Exemplo n.º 2
0
function tie_set_demo_data()
{
    $theme_options = get_option('tie_options');
    $theme_options['social']['facebook'] = 'https://www.facebook.com/';
    $theme_options['social']['twitter'] = 'https://twitter.com/';
    $theme_options['social']['dribbble'] = 'http://dribbble.com/';
    $theme_options['social']['foursquare'] = 'https://foursquare.com/';
    $theme_options['social']['Pinterest'] = 'http://www.pinterest.com//';
    $theme_options['social']['instagram'] = 'http://instagram.com/';
    $theme_options['footer_widgets'] = 'footer-4c';
    $theme_options['banner_top'] = $theme_options['banner_bottom'] = true;
    $theme_options['banner_top_img'] = $theme_options['banner_bottom_img'] = '#';
    $theme_options['banner_top_url'] = $theme_options['banner_bottom_url'] = '#';
    update_option('tie_options', $theme_options);
    //Import Menus
    $top_menu = get_term_by('name', 'top', 'nav_menu');
    $main_menu = get_term_by('name', 'Main Menu', 'nav_menu');
    set_theme_mod('nav_menu_locations', array('top-menu' => $top_menu->term_id, 'primary' => $main_menu->term_id));
    //HomePage
    $cat1 = $cat2 = $cat3 = $cat4 = $cat5 = 1;
    $cat1 = get_cat_ID('World');
    $cat2 = get_cat_ID('Fashion');
    $cat3 = get_cat_ID('Photography');
    $cat4 = get_cat_ID('Sports');
    $cat5 = get_cat_ID('Tech');
    $home_cats = array(array('id' => $cat1, 'order' => 'latest', 'number' => '5', 'offset' => '', 'style' => 'li', 'type' => 'n'), array('id' => $cat2, 'order' => 'latest', 'number' => '3', 'offset' => '', 'style' => '2c', 'type' => 'n'), array('id' => $cat3, 'order' => 'latest', 'number' => '3', 'offset' => '', 'style' => '2c', 'type' => 'n'), array('id' => $cat4, 'title' => 'Scrolling Block', 'number' => '6', 'offset' => '', 'boxid' => 's_1441', 'type' => 's'), array('id' => $cat1, 'title' => 'News In Picture', 'offset' => '', 'boxid' => 'news-pic_1915', 'style' => 'default', 'type' => 'news-pic'), array('id' => $cat5, 'order' => 'latest', 'number' => '5', 'offset' => '', 'style' => '1c', 'type' => 'n'), array('id' => $cat1, 'title' => 'Grid', 'offset' => '', 'boxid' => 'news-pic_1594', 'style' => 'row', 'type' => 'news-pic'), array('cat' => array($cat5, $cat1, $cat4), 'boxid' => 'tabs_11027', 'type' => 'tabs'), array('title' => 'Recent Posts', 'number' => '3', 'offset' => '', 'pagi' => 'true', 'boxid' => 'recent_1562', 'display' => 'blog', 'type' => 'recent'));
    $homepage = array('post_name' => 'tiehome', 'post_title' => 'TieLabs HomePage', 'post_status' => 'publish', 'post_type' => 'page', 'comment_status' => 'closed');
    $homepage_id = wp_insert_post($homepage);
    if (!empty($homepage_id)) {
        //Set the page as a homepage
        update_option('show_on_front', 'page');
        update_option('page_on_front', $homepage_id);
        //Store the page builder elements
        update_post_meta($homepage_id, 'tie_builder_active', 'yes');
        update_post_meta($homepage_id, 'tie_builder', $home_cats);
        //Blocks Meta options
        update_post_meta($homepage_id, 'home_exc_length', '15');
        update_post_meta($homepage_id, 'box_meta_score', 'true');
        update_post_meta($homepage_id, 'box_meta_date', 'true');
        update_post_meta($homepage_id, 'box_meta_comments', 'true');
        //Slider
        update_post_meta($homepage_id, 'featured_posts', 'true');
        update_post_meta($homepage_id, 'featured_auto', 'true');
        update_post_meta($homepage_id, 'featured_posts_speed', '7000');
        update_post_meta($homepage_id, 'featured_posts_time', '600');
        update_post_meta($homepage_id, 'featured_posts_number', 10);
        update_post_meta($homepage_id, 'featured_posts_query', 'category');
        update_post_meta($homepage_id, 'featured_posts_cat', array($cat1, $cat2, $cat3, $cat4, $cat5));
    }
    //Import Widgets
    update_option('sidebars_widgets', '');
    tie_addWidgetToSidebar('primary-widget-area', 'counter-widget', 0, array('facebook' => 'https://www.facebook.com/', 'youtube' => 'http://www.youtube.com/', 'vimeo' => 'http://vimeo.com/'));
    tie_addWidgetToSidebar('primary-widget-area', 'widget_tabs', 0);
    tie_addWidgetToSidebar('primary-widget-area', 'facebook-widget', 0, array('title' => 'Find us on Facebook', 'page_url' => 'https://www.facebook.com/'));
    tie_addWidgetToSidebar('primary-widget-area', 'social', 0, array('title' => 'Social', 'tran_bg' => true, 'icons_size' => 32));
    tie_addWidgetToSidebar('primary-widget-area', 'youtube-widget', 0, array('title' => 'Subscribe to our Channel', 'page_url' => 'TEAMMESAI'));
    tie_addWidgetToSidebar('primary-widget-area', 'login-widget', 0, array('title' => ' Login'));
    tie_addWidgetToSidebar('first-footer-widget-area', 'posts-list-widget', 0, array('title' => 'Popular Posts', 'no_of_posts' => 5, 'thumb' => true, 'posts_order' => 'popular'));
    tie_addWidgetToSidebar('second-footer-widget-area', 'posts-list-widget', 0, array('title' => 'Random Posts', 'no_of_posts' => 5, 'thumb' => true, 'posts_order' => 'random'));
    tie_addWidgetToSidebar('third-footer-widget-area', 'posts-list-widget', 0, array('title' => 'Latest Posts', 'no_of_posts' => 5, 'thumb' => true, 'posts_order' => 'latest'));
    tie_addWidgetToSidebar('fourth-footer-widget-area', 'comments_avatar-widget', 0, array('title' => 'Recent Comments', 'thumb' => true, 'no_of_comments' => 5, 'avatar_size' => 50));
    //Menus
    $home_page = get_page_by_title('home', OBJECT, 'nav_menu_item');
    update_post_meta(intval($home_page->ID), '_menu_item_url', home_url());
}
Exemplo n.º 3
0
function tie_set_demo_data()
{
    $theme_options = get_option('tie_options');
    $cat1 = $cat2 = $cat3 = $cat4 = $cat5 = $cat6 = $cat7 = $cat8 = 1;
    $cat1 = get_cat_ID('Design');
    $cat3 = get_cat_ID('Technology');
    $cat4 = get_cat_ID('Business');
    $cat5 = $cat2 = get_cat_ID('World');
    $cat6 = get_cat_ID('Android');
    $cat7 = get_cat_ID('BlackBerry');
    $cat8 = get_cat_ID('iPhone');
    $home_cats1 = array(array('title' => 'Recent Posts', 'number' => 2, 'display' => 'blog', 'pagi' => 'n', 'boxid' => 'recent_1777', 'type' => 'recent'));
    $home_cats2 = array(array('title' => 'Best Reviews', 'number' => 4, 'order' => 'best', 'boxid' => 'rev_11369', 'id1' => $cat8, 'id2' => $cat7, 'id3' => $cat6, 'type' => 'rev'));
    $home_cats3 = array(array('id' => $cat1, 'order' => 'latest', 'number' => 5, 'style' => 'li', 'type' => 'n'), array('id' => $cat3, 'title' => 'Scrolling Box', 'number' => 12, 'boxid' => 's_11140', 'type' => 's'), array('id' => $cat2, 'order' => 'latest', 'number' => 4, 'style' => '2c', 'type' => 'n'), array('id' => $cat4, 'order' => 'latest', 'number' => 4, 'style' => '2c', 'type' => 'n'), array('id' => $cat1, 'title' => 'News In Picture', 'boxid' => 'news-pic_1775', 'type' => 'news-pic', 'style' => 'default'));
    $home_cats4 = array(array('id' => $cat5, 'title' => 'Scrolling Box', 'number' => 8, 'boxid' => 's_187640', 'type' => 's'));
    $theme_options['social']['facebook'] = 'https://www.facebook.com/TieLabs';
    $theme_options['social']['twitter'] = 'https://twitter.com/mo3aser';
    $theme_options['social']['dribbble'] = 'http://dribbble.com/mo3aser';
    $theme_options['social']['foursquare'] = 'https://foursquare.com/mo3aser';
    $theme_options['social']['Pinterest'] = 'http://www.pinterest.com/mo3aser/';
    $theme_options['social']['instagram'] = 'http://instagram.com/imo3aser';
    $theme_options['on_home'] = 'boxes';
    $theme_options['footer_widgets'] = 'footer-4c';
    $theme_options['slider_type'] = 'flexi';
    $theme_options['slider_cat'] = array($cat1, $cat2, $cat3, $cat4);
    $theme_options['banner_top'] = $theme_options['banner_bottom'] = true;
    $theme_options['banner_top_img'] = $theme_options['banner_bottom_img'] = 'http://themes.tielabs.com/jarida/wp-content/uploads/2013/03/728.jpg';
    $theme_options['banner_top_url'] = $theme_options['banner_bottom_url'] = 'http://themeforest.net/item/jarida-responsive-wordpress-news-magazine-blog/4309191?ref=TieLabs';
    update_option('tie_home_cats1', $home_cats1);
    update_option('tie_home_cats2', $home_cats2);
    update_option('tie_home_cats3', $home_cats3);
    update_option('tie_home_cats4', $home_cats4);
    update_option('tie_options', $theme_options);
    //Import Menus
    $top_menu = get_term_by('name', 'top', 'nav_menu');
    $main_menu = get_term_by('name', 'main', 'nav_menu');
    set_theme_mod('nav_menu_locations', array('top-menu' => $top_menu->term_id, 'primary' => $main_menu->term_id));
    //Import Widgets
    update_option('sidebars_widgets', '');
    tie_addWidgetToSidebar('primary-widget-area', 'counter-widget', 0, array('facebook' => 'https://www.facebook.com/TieLabs', 'youtube' => 'http://www.youtube.com/user/TEAMMESAI', 'vimeo' => 'http://vimeo.com/channels/kidproof'));
    tie_addWidgetToSidebar('primary-widget-area', 'widget_tabs', 0);
    tie_addWidgetToSidebar('primary-widget-area', 'facebook-widget', 0, array('title' => 'Find us on Facebook', 'page_url' => 'https://www.facebook.com/TieLabs'));
    tie_addWidgetToSidebar('primary-widget-area', 'social', 0, array('title' => 'Social', 'tran_bg' => true, 'icons_size' => 32));
    tie_addWidgetToSidebar('primary-widget-area', 'youtube-widget', 0, array('title' => 'Subscribe to our Channel', 'page_url' => 'TEAMMESAI'));
    tie_addWidgetToSidebar('primary-widget-area', 'video-widget', 0, array('title' => ' Featured Video', 'youtube_video' => 'UjXi6X-moxE'));
    tie_addWidgetToSidebar('primary-widget-area', 'login-widget', 0, array('title' => ' Login'));
    tie_addWidgetToSidebar('first-footer-widget-area', 'posts-list-widget', 0, array('title' => 'Popular Posts', 'no_of_posts' => 5, 'thumb' => true, 'posts_order' => 'popular'));
    tie_addWidgetToSidebar('second-footer-widget-area', 'posts-list-widget', 0, array('title' => 'Random Posts', 'no_of_posts' => 5, 'thumb' => true, 'posts_order' => 'random'));
    tie_addWidgetToSidebar('third-footer-widget-area', 'posts-list-widget', 0, array('title' => 'Latest Posts', 'no_of_posts' => 5, 'thumb' => true, 'posts_order' => 'latest'));
    tie_addWidgetToSidebar('fourth-footer-widget-area', 'comments_avatar-widget', 0, array('title' => 'Recent Comments', 'thumb' => true, 'no_of_comments' => 5, 'avatar_size' => 50));
    tie_addWidgetToSidebar('homepage-normal-widget-area1', 'counter-widget', 0, array('facebook' => 'https://www.facebook.com/TieLabs', 'youtube' => 'http://www.youtube.com/user/TEAMMESAI', 'vimeo' => 'http://vimeo.com/channels/kidproof'));
    tie_addWidgetToSidebar('homepage-normal-widget-area1', 'widget_tabs', 0);
    tie_addWidgetToSidebar('homepage-normal-widget-area2', 'facebook-widget', 0, array('title' => 'Find us on Facebook', 'page_url' => 'https://www.facebook.com/TieLabs'));
    tie_addWidgetToSidebar('homepage-normal-widget-area2', 'social', 0, array('title' => 'Social', 'tran_bg' => true, 'icons_size' => 32));
    tie_addWidgetToSidebar('homepage-normal-widget-area2', 'youtube-widget', 0, array('title' => 'Subscribe to our Channel', 'page_url' => 'TEAMMESAI'));
    tie_addWidgetToSidebar('homepage-normal-widget-area2', 'video-widget', 0, array('title' => ' Featured Video', 'youtube_video' => 'UjXi6X-moxE'));
    tie_addWidgetToSidebar('homepage-normal-widget-area2', 'login-widget', 0, array('title' => ' Login'));
    tie_addWidgetToSidebar('homepage-narrow-widget-area1', 'archives', 0);
    tie_addWidgetToSidebar('homepage-narrow-widget-area1', 'categories', 0);
    tie_addWidgetToSidebar('homepage-narrow-widget-area1', 'meta', 0);
    tie_addWidgetToSidebar('homepage-narrow-widget-area2', 'tag_cloud', 0);
    tie_addWidgetToSidebar('homepage-narrow-widget-area2', 'recent-comments', 0);
    tie_addWidgetToSidebar('homepage-narrow-widget-area2', 'recent-posts', 0);
    tie_addWidgetToSidebar('narrow-primary-widget-area', 'archives', 0);
    tie_addWidgetToSidebar('narrow-primary-widget-area', 'categories', 0);
    tie_addWidgetToSidebar('narrow-primary-widget-area', 'meta', 0);
    tie_addWidgetToSidebar('narrow-primary-widget-area', 'tag_cloud', 0);
    tie_addWidgetToSidebar('narrow-primary-widget-area', 'recent-comments', 0);
    tie_addWidgetToSidebar('narrow-primary-widget-area', 'recent-posts', 0);
}