├── inc
├── demo-data
│ ├── screen-image.jpg
│ ├── css
│ │ └── demo-import.css
│ ├── hostza-customizer.dat
│ ├── hostza-widgets-demo.wie
│ └── demo-import.php
├── elementor-widgets
│ ├── assets
│ │ ├── css
│ │ │ ├── elementor-edit.css
│ │ │ ├── utility.css
│ │ │ ├── owl.carousel.min.css
│ │ │ └── magnific-popup.css
│ │ ├── fonts
│ │ │ └── themify-icon
│ │ │ │ └── fonts
│ │ │ │ ├── themify.eot
│ │ │ │ ├── themify.ttf
│ │ │ │ └── themify.woff
│ │ └── js
│ │ │ ├── map-active.js
│ │ │ ├── progress-loader-canvas.js
│ │ │ ├── jquery.counterup.js
│ │ │ ├── imagesLoaded.js
│ │ │ ├── hostza-companion-main.js
│ │ │ ├── barfiller.js
│ │ │ ├── waypoints.js
│ │ │ └── jquery.youtubebackground.js
│ └── widgets
│ │ ├── single-pricing-table.php
│ │ ├── hero-section.php
│ │ ├── core-feature-tab-items.php
│ │ ├── statistics.php
│ │ ├── price-table.php
│ │ ├── blog.php
│ │ ├── simple-contact-section.php
│ │ ├── faq-tab-item.php
│ │ ├── support-section.php
│ │ ├── contact.php
│ │ ├── lets-launch.php
│ │ ├── video-section.php
│ │ └── core-features.php
├── hostza-metabox.php
├── sidebar-widgets
│ ├── instagram.php
│ ├── blog-widget.php
│ ├── newsletter-widget.php
│ ├── social-links.php
│ └── about-widget.php
├── instagram-api.php
└── functions.php
├── js
├── common.js
└── loadmore-ajax.js
├── hostza-init.php
├── hostza-companion.php
└── readme.txt
/inc/demo-data/screen-image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ColorlibHQ/hostza-companion/master/inc/demo-data/screen-image.jpg
--------------------------------------------------------------------------------
/inc/elementor-widgets/assets/css/elementor-edit.css:
--------------------------------------------------------------------------------
1 | .elementor-choices-label i {
2 | font-size: 18px !important;
3 | padding: 5px 0;
4 | }
--------------------------------------------------------------------------------
/inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ColorlibHQ/hostza-companion/master/inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.eot
--------------------------------------------------------------------------------
/inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ColorlibHQ/hostza-companion/master/inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.ttf
--------------------------------------------------------------------------------
/inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ColorlibHQ/hostza-companion/master/inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.woff
--------------------------------------------------------------------------------
/inc/demo-data/css/demo-import.css:
--------------------------------------------------------------------------------
1 | .ocdi__demo-import-notice:not(:empty) {
2 | background-color: transparent !important;
3 | border-left: 0px !important;
4 | box-shadow: none !important;
5 | padding: 0px !important;
6 | }
7 | .ocdi__demo-import-notice img {
8 | border: 4px solid #dbe3ea;
9 | width: auto;
10 | }
11 | .about-wrap .ocdi__demo-import-notice img {
12 | width: auto;
13 | }
14 | .about-wrap img {
15 | width: auto;
16 | }
--------------------------------------------------------------------------------
/inc/hostza-metabox.php:
--------------------------------------------------------------------------------
1 | 'page_single_metaboxs',
7 | 'title' => esc_html__( 'Page Footer Options', 'hostza-companion' ),
8 | 'post_types'=> array( 'page' ),
9 | 'priority' => 'high',
10 | 'autosave' => 'false',
11 | 'fields' => array(
12 | array(
13 | 'id' => $hostza_prefix . 'footer-background',
14 | 'type' => 'background',
15 | 'name' => esc_html__( 'Set The Footer Background', 'hostza-companion' ),
16 | ),
17 | ),
18 | );
19 |
20 |
21 | return $meta_boxes;
22 | }
23 | add_filter( 'rwmb_meta_boxes', 'hostza_page_metabox' );
--------------------------------------------------------------------------------
/js/common.js:
--------------------------------------------------------------------------------
1 | (function ($) {
2 | "use strict";
3 | /*-------------------------------------
4 | Instagram Photos
5 | -------------------------------------*/
6 | function cp_instagram_photos() {
7 | $('.cp-instagram-photos').each(function(){
8 | $.instagramFeed({
9 | 'username': $(this).data('username'),
10 | 'container': $(this),
11 | 'display_profile': false,
12 | 'display_biography': false,
13 | 'items': $(this).data('items'),
14 | 'margin': 0
15 | });
16 | console.log( $(this) );
17 | });
18 |
19 | }
20 | cp_instagram_photos();
21 | })(jQuery);
--------------------------------------------------------------------------------
/inc/elementor-widgets/assets/css/utility.css:
--------------------------------------------------------------------------------
1 | /* -------------------------
2 | :: utility Class
3 | ---------------------------- */
4 | .hostza-pt-100 {
5 | padding-top: 100px;
6 | }
7 | .hostza-pt-80 {
8 | padding-top: 80px;
9 | }
10 | .hostza-pt-70 {
11 | padding-top: 70px;
12 | }
13 | .hostza-pt-60 {
14 | padding-top: 60px;
15 | }
16 | .hostza-pt-50 {
17 | padding-top: 50px;
18 | }
19 | .hostza-pt-30 {
20 | padding-top: 30px;
21 | }
22 | .hostza-pb-100 {
23 | padding-bottom: 100px;
24 | }
25 | .hostza-pb-80 {
26 | padding-bottom: 80px;
27 | }
28 | .hostza-pb-70 {
29 | padding-bottom: 70px;
30 | }
31 | .hostza-pb-60 {
32 | padding-bottom: 60px;
33 | }
34 | .hostza-pb-50 {
35 | padding-bottom: 50px;
36 | }
37 | .hostza-pb-30 {
38 | padding-bottom: 30px;
39 | }
40 |
--------------------------------------------------------------------------------
/hostza-init.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/inc/demo-data/hostza-customizer.dat:
--------------------------------------------------------------------------------
1 | a:4:{s:8:"template";s:6:"hostza";s:4:"mods";a:20:{i:0;b:0;s:18:"nav_menu_locations";a:3:{s:12:"primary-menu";i:28;s:12:"service-menu";i:32;s:15:"navigation-menu";i:29;}s:18:"custom_css_post_id";i:-1;s:27:"hostza_footer_widget_toggle";b:1;s:16:"hostza_blog_meta";b:1;s:15:"hostza_like_btn";b:1;s:17:"hostza_blog_share";b:1;s:11:"custom_logo";i:37;s:22:"hostza_footer_bg_color";s:7:"#2e004b";s:31:"hostza_footer_widget_text_color";s:7:"#999999";s:33:"hostza_footer_widget_anchor_color";s:7:"#bababa";s:32:"hostza_footer_widget_title_color";s:7:"#ffffff";s:39:"hostza_footer_widget_anchor_hover_color";s:7:"#00d363";s:22:"hostza_header_bg_color";s:7:"#2e004b";s:24:"hostza_header_menu_color";s:7:"#ffffff";s:30:"hostza_header_menu_hover_color";s:7:"#ffffff";s:29:"hostza_header_drop_menu_color";s:7:"#000000";s:35:"hostza_header_drop_menu_hover_color";s:7:"#000000";s:31:"hostza_header_menu_border_color";s:7:"#00d363";s:29:"hostza_header_right_btn_color";s:7:"#00d363";}s:7:"options";a:2:{s:9:"site_icon";s:2:"41";s:23:"nav_menus_created_posts";a:0:{}}s:6:"wp_css";s:0:"";}
--------------------------------------------------------------------------------
/inc/demo-data/hostza-widgets-demo.wie:
--------------------------------------------------------------------------------
1 | {"sidebar_widgets":{"search-2":{"title":""},"categories-3":{"title":"Categories","count":1,"hierarchical":0,"dropdown":0},"hostza_blog_widget-1":{"sectiontitle":"Recent Post","postnumber":"4","style":"1"},"tag_cloud-1":{"title":"Tag Clouds","count":0,"taxonomy":"post_tag"},"hostza_newsletter-1":{"title":"Newsletter","actionurl":"https:\/\/spondonit.us12.list-manage.com\/subscribe\/post?u=1462626880ade1ac87bd9c93a&id=92a4423d01","desc":""}},"footer-1":{"text-3":{"title":"","text":"
29 |
30 |
31 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | access_token = hostza_opt( 'hostza_igaccess_token' );
42 | }
43 |
44 | /**
45 | * @param $screen_name string Instagram username
46 | * @param $image_limit int Number of images to retrieve
47 | * @param $image_width int Desired image width to retrieve
48 | *
49 | * @return array|bool Array of tweets or false if method fails
50 | */
51 | public function get_items( $image_limit, $image_width ) {
52 |
53 | $transient = 'zoom_instagram_is_configured';
54 |
55 | $response = wp_remote_get( sprintf( 'https://api.instagram.com/v1/users/self/media/recent/?access_token=%s&count=%s', $this->access_token, $image_limit ) );
56 |
57 |
58 | if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
59 | set_transient( $transient, false, MINUTE_IN_SECONDS );
60 |
61 | return false;
62 | }
63 |
64 |
65 |
66 | $data = json_decode( wp_remote_retrieve_body( $response ) );
67 |
68 | $result = array();
69 | $username = '';
70 |
71 | foreach ( $data->data as $item ) {
72 |
73 | if(empty($username)){
74 | $username = $item->user->username;
75 | }
76 |
77 | $result[] = array(
78 | 'link' => $item->link,
79 | 'image-url' => $item->images->{ $this->get_best_size( $image_width ) }->url,
80 | 'likes' => $item->likes->count,
81 | 'comments' => $item->comments->count,
82 | 'location' => !empty( $item->location->name ) ? $item->location->name : ''
83 | );
84 | }
85 |
86 | $result = array('items' => $result, 'username'=> $username );
87 | set_transient( $transient, $result, 30 * MINUTE_IN_SECONDS );
88 |
89 | return $result;
90 | }
91 |
92 | /**
93 | * @param $screen_name string Instagram username
94 | *
95 | * @return bool|int Instagram user id or false on error
96 | */
97 | protected function get_user_id( $screen_name ) {
98 | $user_id_option = 'zoom_instagram_uid_' . $screen_name;
99 |
100 | if ( false !== ( $user_id = get_option( $user_id_option ) ) ) {
101 | return $user_id;
102 | }
103 |
104 | $response = wp_remote_get( sprintf( 'https://api.instagram.com/v1/users/search?q=%s&access_token=%s', $screen_name, $this->access_token ) );
105 |
106 | if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
107 | return false;
108 | }
109 |
110 | $result = json_decode( wp_remote_retrieve_body( $response ) );
111 |
112 | if ( ! isset( $result->data ) ) {
113 | return false;
114 | }
115 |
116 | $user_id = false;
117 |
118 | foreach ( $result->data as $user ) {
119 | if ( $user->username === $screen_name ) {
120 | $user_id = $user->id;
121 |
122 | break;
123 | }
124 | }
125 |
126 | update_option( $user_id_option, $user_id );
127 |
128 | return $user_id;
129 | }
130 |
131 | /**
132 | * @param $desired_width int Desired image width in pixels
133 | *
134 | * @return string Image size for Instagram API
135 | */
136 | protected function get_best_size( $desired_width ) {
137 | $size = 'thumbnail';
138 | $sizes = array(
139 | 'thumbnail' => 137,
140 | 'low_resolution' => 150,
141 | 'standard_resolution' => 640
142 | );
143 |
144 | $diff = PHP_INT_MAX;
145 |
146 | foreach ( $sizes as $key => $value ) {
147 | if ( abs( $desired_width - $value ) < $diff ) {
148 | $size = $key;
149 | $diff = abs( $desired_width - $value );
150 | }
151 | }
152 |
153 | return $size;
154 | }
155 |
156 | /**
157 | * Check if given access token is valid for Instagram Api.
158 | */
159 | public static function is_access_token_valid( $access_token ) {
160 | $response = wp_remote_get( sprintf( 'https://api.instagram.com/v1/users/self/?access_token=%s', $access_token ) );
161 |
162 | if ( is_wp_error( $response ) ) {
163 | return $response;
164 | }
165 |
166 | if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
167 | return false;
168 | }
169 |
170 | return true;
171 | }
172 |
173 | public function is_configured() {
174 | $transient = 'zoom_instagram_is_configured';
175 |
176 | if ( false !== ( $result = get_transient( $transient ) ) ) {
177 | if ( 'yes' === $result ) {
178 | return true;
179 | }
180 |
181 | if ( 'no' === $result ) {
182 | return false;
183 | }
184 | }
185 |
186 | $condition = $this->is_access_token_valid( $this->access_token );
187 |
188 | if ( true === $condition ) {
189 | set_transient( $transient, 'yes', DAY_IN_SECONDS );
190 |
191 | return true;
192 | }
193 |
194 | set_transient( $transient, 'no', DAY_IN_SECONDS );
195 |
196 | return false;
197 | }
198 |
199 | public static function reset_cache() {
200 | delete_transient( 'zoom_instagram_is_configured' );
201 | }
202 |
203 | public function get_access_token() {
204 | return $this->access_token;
205 | }
206 |
207 | public function set_access_token( $access_token ) {
208 | $this->access_token = $access_token;
209 | }
210 | }
211 | ?>
--------------------------------------------------------------------------------
/inc/sidebar-widgets/blog-widget.php:
--------------------------------------------------------------------------------
1 | esc_html__( 'Show most latest blog post.', 'hostza-companion' ), )
34 | );
35 |
36 | }
37 |
38 | // This is where the action happens
39 | public function widget( $args, $instance ) {
40 | $title = apply_filters( 'hostza_blog_sectiontitle', $instance['sectiontitle'] );
41 | $postnumber = apply_filters( 'hostza_blog_postnumber', $instance['postnumber'] );
42 | $style = apply_filters( 'hostza_blog_style', $instance['style'] );
43 |
44 | // before and after widget arguments are defined by themes
45 | echo wp_kses_post( $args['before_widget'] );
46 | if ( ! empty( $title ) )
47 | echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
48 |
49 |
50 | ?>
51 |
52 |
53 | 'post',
56 | 'posts_per_page' => esc_html( $postnumber ),
57 | );
58 |
59 | $query = new WP_Query( $blogargs );
60 |
61 | if( $query->have_posts() ):
62 | while( $query->have_posts() ):
63 | $query->the_post();
64 | ?>
65 |
69 |
72 |
73 | 'img-fluid']); ?>
74 |
75 |
81 |
82 |
85 |
88 |
96 |
102 |
103 |
104 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
150 |
151 |
152 | esc_html__( 'Add footer newsletter signup form.', 'hostza-companion' ), )
28 | );
29 |
30 | }
31 |
32 | // This is where the action happens
33 | public function widget( $args, $instance ) {
34 |
35 | $title = apply_filters( 'widget_title', $instance['title'] );
36 | $actionurl = apply_filters( 'widget_actionurl', $instance['actionurl'] );
37 | $desc = apply_filters( 'widget_desc', $instance['desc'] );
38 |
39 | // before and after widget arguments are defined by themes
40 | echo wp_kses_post( $args['before_widget'] );
41 | if ( ! empty( $title ) )
42 | echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
43 | if( $desc ){
44 | echo ''.esc_html( $desc ).'
';
45 | }
46 | ?>
47 |
65 |
66 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 | start_controls_section(
47 | 'single_pricing_item_content',
48 | [
49 | 'label' => __( 'Single Pricing Item', 'hostza-companion' ),
50 | ]
51 | );
52 | $this->add_control(
53 | 'sites',
54 | [
55 | 'label' => __( 'Sites', 'hostza-companion' ),
56 | 'type' => Controls_Manager::TEXT,
57 | 'label_block' => true,
58 | 'default' => __( '1 Site', 'hostza-companion' ),
59 | ]
60 | );
61 | $this->add_control(
62 | 'visits',
63 | [
64 | 'label' => __( 'Visits Per Month', 'hostza-companion' ),
65 | 'type' => Controls_Manager::TEXT,
66 | 'label_block' => true,
67 | 'default' => __( '100k Visits Per Month', 'hostza-companion' ),
68 | ]
69 | );
70 | $this->add_control(
71 | 'storage',
72 | [
73 | 'label' => __( 'Storage', 'hostza-companion' ),
74 | 'type' => Controls_Manager::TEXT,
75 | 'label_block' => true,
76 | 'default' => __( '1GB Backups', 'hostza-companion' ),
77 | ]
78 | );
79 | $this->add_control(
80 | 'ssl',
81 | [
82 | 'label' => __( 'SSL Certificate', 'hostza-companion' ),
83 | 'type' => Controls_Manager::TEXT,
84 | 'label_block' => true,
85 | 'default' => __( 'Free SSL Certificate', 'your-plugin' ),
86 | ]
87 | );
88 | $this->add_control(
89 | 'support',
90 | [
91 | 'label' => __( 'Support', 'hostza-companion' ),
92 | 'type' => Controls_Manager::TEXT,
93 | 'label_block' => true,
94 | 'default' => __( 'Quick support', 'hostza-companion' ),
95 | ]
96 | );
97 | $this->add_control(
98 | 'price',
99 | [
100 | 'label' => __( 'Price', 'hostza-companion' ),
101 | 'type' => Controls_Manager::TEXT,
102 | 'label_block' => true,
103 | 'default' => __( '$2.5/m', 'hostza-companion' ),
104 | ]
105 | );
106 | $this->add_control(
107 | 'btn_label',
108 | [
109 | 'label' => __( 'Button Label', 'hostza-companion' ),
110 | 'type' => Controls_Manager::TEXT,
111 | 'label_block' => true,
112 | 'default' => __( 'Start Now', 'hostza-companion' ),
113 | ]
114 | );
115 | $this->add_control(
116 | 'btn_url',
117 | [
118 | 'label' => __( 'Button URL', 'hostza-companion' ),
119 | 'type' => Controls_Manager::URL,
120 | 'label_block' => true,
121 | ]
122 | );
123 | $this->end_controls_section(); // End service content
124 |
125 | }
126 |
127 | protected function render() {
128 | $settings = $this->get_settings();
129 | $sites = !empty( $settings['sites'] ) ? $settings['sites'] : '';
130 | $visits = !empty( $settings['visits'] ) ? $settings['visits'] : '';
131 | $storage = !empty( $settings['storage'] ) ? $settings['storage'] : '';
132 | $ssl = !empty( $settings['ssl'] ) ? $settings['ssl'] : '';
133 | $support = !empty( $settings['support'] ) ? $settings['support'] : '';
134 | $price = !empty( $settings['price'] ) ? $settings['price'] : '';
135 | $btn_label = !empty( $settings['btn_label'] ) ? $settings['btn_label'] : '';
136 | $btn_url = !empty( $settings['btn_url']['url'] ) ? $settings['btn_url']['url'] : '';
137 | ?>
138 |
139 |
140 |
141 |
142 | {$sites}";
145 | }
146 | if ( $visits ) {
147 | echo "- {$visits}
";
148 | }
149 | if ( $storage ) {
150 | echo "- {$storage}
";
151 | }
152 | if ( $ssl ) {
153 | echo "- {$ssl}
";
154 | }
155 | if ( $support ) {
156 | echo "- {$support}
";
157 | }
158 | ?>
159 |
160 |
161 | Start from
{$price}";
164 | }
165 | if ( $btn_label ) {
166 | echo "
167 |
172 | ";
173 | }
174 | ?>
175 |
176 | start_controls_section(
48 | 'hero_content',
49 | [
50 | 'label' => __( 'Hero content', 'hostza-companion' ),
51 | ]
52 | );
53 |
54 | $this->add_control(
55 | 'banner_img', [
56 | 'label' => __( 'BG Image', 'hostza-companion' ),
57 | 'type' => Controls_Manager::MEDIA,
58 |
59 | ]
60 | );
61 | $this->add_control(
62 | 'sub_title', [
63 | 'label' => __( 'Sub Title', 'hostza-companion' ),
64 | 'type' => Controls_Manager::TEXT,
65 | 'label_block' => true,
66 | 'default' => 'The Best Domain & Hosting Provider In The Area'
67 | ]
68 | );
69 | $this->add_control(
70 | 'big_title', [
71 | 'label' => __( 'Big Title', 'hostza-companion' ),
72 | 'type' => Controls_Manager::TEXTAREA,
73 | 'label_block' => true,
74 | 'default' => 'Go Big with your next Domain'
75 | ]
76 | );
77 | $this->add_control(
78 | 'action_page', [
79 | 'label' => __( 'Action Page', 'hostza-companion' ),
80 | 'type' => Controls_Manager::URL,
81 | 'label_block' => true,
82 | ]
83 | );
84 | $this->add_control(
85 | 'btn_label', [
86 | 'label' => __( 'Button Label', 'hostza-companion' ),
87 | 'type' => Controls_Manager::TEXT,
88 | 'label_block' => true,
89 | 'default' => 'search'
90 | ]
91 | );
92 |
93 | $this->end_controls_section(); // End Hero content
94 |
95 |
96 | /**
97 | * Style Tab
98 | * ------------------------------ Style Title ------------------------------
99 | *
100 | */
101 | $this->start_controls_section(
102 | 'style_title', [
103 | 'label' => __( 'Style Hero Section', 'hostza-companion' ),
104 | 'tab' => Controls_Manager::TAB_STYLE,
105 | ]
106 | );
107 | $this->add_control(
108 | 'sub_title_col', [
109 | 'label' => __( 'Sub Title Color', 'hostza-companion' ),
110 | 'type' => Controls_Manager::COLOR,
111 | 'selectors' => [
112 | '{{WRAPPER}} .slider_area .single_slider .slider_text p' => 'color: {{VALUE}};',
113 | ],
114 | ]
115 | );
116 | $this->add_control(
117 | 'big_title_col', [
118 | 'label' => __( 'Big Title Color', 'hostza-companion' ),
119 | 'type' => Controls_Manager::COLOR,
120 | 'selectors' => [
121 | '{{WRAPPER}} .slider_area .single_slider .slider_text h3' => 'color: {{VALUE}};',
122 | ],
123 | ]
124 | );
125 | $this->add_control(
126 | 'btn_bg_col', [
127 | 'label' => __( 'Button Bg Color', 'hostza-companion' ),
128 | 'type' => Controls_Manager::COLOR,
129 | 'selectors' => [
130 | '{{WRAPPER}} .slider_area .find_dowmain .find_dowmain_form button' => 'background: {{VALUE}};',
131 | ],
132 | ]
133 | );
134 |
135 | $this->end_controls_section();
136 | }
137 |
138 | protected function render() {
139 | $settings = $this->get_settings();
140 | $banner_img = !empty( $settings['banner_img']['url'] ) ? $settings['banner_img']['url'] : '';
141 | $sub_title = !empty( $settings['sub_title'] ) ? esc_html($settings['sub_title']) : '';
142 | $big_title = !empty( $settings['big_title'] ) ? wp_kses_post(nl2br($settings['big_title'])) : '';
143 | $action_page = !empty( $settings['action_page'] ) ? esc_url($settings['action_page']['url']) : '#';
144 | $btn_label = !empty( $settings['btn_label'] ) ? esc_html($settings['btn_label']) : '';
145 | ?>
146 |
147 |
148 |
149 |
>
150 |
151 |
152 |
153 |
154 | {$sub_title}";
157 | }
158 | if ( $big_title ) {
159 | echo "
{$big_title}
";
160 | }
161 | ?>
162 |
163 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 | start_controls_section(
47 | 'core_feature_tab_content',
48 | [
49 | 'label' => __( 'Core Feature Tab Item', 'hostza-companion' ),
50 | ]
51 | );
52 |
53 | $this->add_control(
54 | 'feature_items', [
55 | 'label' => __( 'Create New', 'hostza-companion' ),
56 | 'type' => Controls_Manager::REPEATER,
57 | 'title_field' => '{{{ item_title }}}',
58 | 'fields' => [
59 | [
60 | 'name' => 'item_icon',
61 | 'label' => __( 'Select Icon', 'hostza-companion' ),
62 | 'label_block' => true,
63 | 'type' => Controls_Manager::ICON,
64 | 'options' => hostza_themify_icon(),
65 | 'default' => 'flaticon-browser',
66 | ],
67 | [
68 | 'name' => 'item_title',
69 | 'label' => __( 'Item Title', 'hostza-companion' ),
70 | 'label_block' => true,
71 | 'type' => Controls_Manager::TEXT,
72 | 'default' => __( 'Free Domain for 1st Year', 'hostza-companion' ),
73 | ],
74 | [
75 | 'name' => 'item_text',
76 | 'label' => __( 'Item Text', 'hostza-companion' ),
77 | 'label_block' => true,
78 | 'type' => Controls_Manager::TEXTAREA,
79 | 'default' => __( 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our let god moving.', 'hostza-companion' ),
80 | ],
81 | ],
82 | 'default' => [
83 | [
84 | 'item_icon' => 'flaticon-browser',
85 | 'item_title' => __( 'Free Domain for 1st Year', 'hostza-companion' ),
86 | 'item_text' => __( 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our let god moving.', 'hostza-companion' ),
87 | ],
88 | [
89 | 'item_icon' => 'flaticon-security',
90 | 'item_title' => __( 'Free SSL Certificate', 'hostza-companion' ),
91 | 'item_text' => __( 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our let god moving.', 'hostza-companion' ),
92 | ],
93 | [
94 | 'item_icon' => 'flaticon-like',
95 | 'item_title' => __( '30-Day Money-Back Guarantee', 'hostza-companion' ),
96 | 'item_text' => __( 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our let god moving.', 'hostza-companion' ),
97 | ],
98 | [
99 | 'item_icon' => 'flaticon-lock',
100 | 'item_title' => __( 'Spam Protection', 'hostza-companion' ),
101 | 'item_text' => __( 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our let god moving.', 'hostza-companion' ),
102 | ],
103 | ]
104 | ]
105 | );
106 | $this->end_controls_section(); // End service content
107 |
108 | }
109 |
110 | protected function render() {
111 | $settings = $this->get_settings();
112 | $feature_items = !empty( $settings['feature_items'] ) ? $settings['feature_items'] : '';
113 |
114 | echo '';
115 | if( is_array( $feature_items ) && count( $feature_items ) > 0 ) {
116 | foreach( $feature_items as $item ) {
117 | $item_icon = ( !empty( $item['item_icon'] ) ) ? esc_attr($item['item_icon']) : '';
118 | $item_title = ( !empty( $item['item_title'] ) ) ? esc_html($item['item_title']) : '';
119 | $item_text = ( !empty( $item['item_text'] ) ) ? esc_html($item['item_text']) : '';
120 | ?>
121 |
122 |
123 | ';
125 | if ( $item_icon ) {
126 | echo "";
127 | }
128 | echo '
';
129 | ?>
130 |
131 | {$item_title}";
134 | }
135 | if ( $item_text ) {
136 | echo "
{$item_text}
";
137 | }
138 | ?>
139 |
140 |
141 |
142 | ';
146 | }
147 | }
--------------------------------------------------------------------------------
/inc/elementor-widgets/assets/js/hostza-companion-main.js:
--------------------------------------------------------------------------------
1 | (function ($) {
2 | 'use strict';
3 |
4 | if ($.fn.owlCarousel) {
5 | $(".hero-slides").owlCarousel({
6 | items: 1,
7 | loop: true,
8 | autoplay: true,
9 | smartSpeed: 800,
10 | margin: 0,
11 | dots: false,
12 | nav: true,
13 | navText: ['', '']
14 | });
15 | }
16 |
17 | if ($.fn.owlCarousel) {
18 | $(".hostza-service-slides").owlCarousel({
19 | items: 3,
20 | loop: true,
21 | autoplay: true,
22 | smartSpeed: 800,
23 | margin: 30,
24 | center: true,
25 | dots: false,
26 | nav: true,
27 | startPosition: 1,
28 | navText: ['', ''],
29 | responsive: {
30 | 0: {
31 | items: 1
32 | },
33 | 576: {
34 | items: 2
35 | },
36 | 768: {
37 | items: 3
38 | }
39 | }
40 | });
41 | }
42 |
43 | if ($.fn.owlCarousel) {
44 | $(".hostza-workflow-slides").owlCarousel({
45 | items: 3,
46 | loop: true,
47 | autoplay: true,
48 | smartSpeed: 800,
49 | margin: 30,
50 | center: true,
51 | dots: true,
52 | startPosition: 1,
53 | responsive: {
54 | 0: {
55 | items: 1
56 | },
57 | 576: {
58 | items: 2
59 | },
60 | 768: {
61 | items: 3
62 | }
63 | }
64 | });
65 | }
66 |
67 | if ($.fn.owlCarousel) {
68 | $(".hostza-team-slides").owlCarousel({
69 | items: 3,
70 | loop: true,
71 | autoplay: true,
72 | smartSpeed: 800,
73 | margin: 50,
74 | center: true,
75 | nav: true,
76 | navText: ['', ''],
77 | responsive: {
78 | 0: {
79 | items: 1
80 | },
81 | 576: {
82 | items: 2
83 | },
84 | 768: {
85 | items: 3
86 | }
87 | }
88 | });
89 | }
90 |
91 | if ($.fn.owlCarousel) {
92 | $(".testimonials-slides").owlCarousel({
93 | items: 3,
94 | loop: true,
95 | autoplay: true,
96 | smartSpeed: 1500,
97 | margin: 0,
98 | center: true,
99 | nav: true,
100 | navText: ['', ''],
101 | responsive: {
102 | 0: {
103 | items: 1
104 | },
105 | 576: {
106 | items: 2
107 | },
108 | 768: {
109 | items: 3
110 | }
111 | }
112 | });
113 | }
114 |
115 | if ($.fn.barfiller) {
116 |
117 | $('.bar').each( function(){
118 | var $this = $(this),
119 | $color = $this.data('color');
120 |
121 | $this.barfiller({
122 | tooltip: true,
123 | duration: 1000,
124 | barColor: $color,
125 | animateOnResize: true
126 | });
127 |
128 |
129 | })
130 |
131 | }
132 | if ($.fn.imagesLoaded) {
133 | $('.hostza-portfolio').imagesLoaded(function () {
134 | // filter items on button click
135 | $('.portfolio-menu').on('click', 'p', function () {
136 | var filterValue = $(this).attr('data-filter');
137 | $grid.isotope({
138 | filter: filterValue
139 | });
140 | });
141 | // init Isotope
142 | var $grid = $('.hostza-portfolio').isotope({
143 | itemSelector: '.single_gallery_item',
144 | percentPosition: true,
145 | masonry: {
146 | columnWidth: '.single_gallery_item'
147 | }
148 | });
149 | });
150 | }
151 |
152 | $('.portfolio-menu button.btn').on('click', function () {
153 | $('.portfolio-menu button.btn').removeClass('active');
154 | $(this).addClass('active');
155 | })
156 | if ($.fn.scrollUp) {
157 | $.scrollUp({
158 | scrollSpeed: 1500,
159 | scrollText: ''
160 | });
161 | }
162 |
163 | if ($.fn.counterUp) {
164 | $('.counter').counterUp({
165 | delay: 10,
166 | time: 2000
167 | });
168 | }
169 |
170 | // Background video
171 | var $selector = $('[data-videoid]');
172 |
173 | if( $selector.length ){
174 | $selector.each( function(){
175 | var $this = $(this);
176 | $this.YTPlayer({
177 | fitToBackground: true,
178 | videoId: $this.data('videoid')
179 | });
180 | });
181 | }
182 |
183 | // MC Scripts
184 | var $subscribe = $( '.hostza-subscribe-newsletter-area' );
185 | if( $subscribe.length ){
186 | window.fnames = new Array();
187 | window.ftypes = new Array();
188 | fnames[0]='EMAIL';
189 | ftypes[0]='email';
190 | fnames[1]='FNAME';
191 | ftypes[1]='text';
192 | fnames[2]='LNAME';
193 | ftypes[2]='text';
194 | fnames[3]='ADDRESS';
195 | ftypes[3]='address';
196 | fnames[4]='PHONE';
197 | ftypes[4]='phone';
198 | fnames[5]='BIRTHDAY';
199 | ftypes[5]='birthday';
200 | }
201 |
202 |
203 |
204 | })(jQuery);
--------------------------------------------------------------------------------
/inc/elementor-widgets/assets/js/barfiller.js:
--------------------------------------------------------------------------------
1 | /*
2 | * File: jquery.barfiller.js
3 | * Version: 1.0.1
4 | * Description: A plugin that fills bars with a percentage you set.
5 | * Author: 9bit Studios
6 | * Copyright 2012, 9bit Studios
7 | * http://www.9bitstudios.com
8 | * Free to use and abuse under the MIT license.
9 | * http://www.opensource.org/licenses/mit-license.php
10 | */
11 |
12 | (function ($) {
13 |
14 | $.fn.barfiller = function (options) {
15 |
16 | var defaults = $.extend({
17 | barColor: '#16b597',
18 | tooltip: true,
19 | duration: 1000,
20 | animateOnResize: true,
21 | symbol: "%"
22 | }, options);
23 |
24 |
25 | /******************************
26 | Private Variables
27 | *******************************/
28 |
29 | var object = $(this);
30 | var settings = $.extend(defaults, options);
31 | var barWidth = object.width();
32 | var fill = object.find('.fill');
33 | var toolTip = object.find('.tip');
34 | var fillPercentage = fill.attr('data-percentage');
35 | var resizeTimeout;
36 | var transitionSupport = false;
37 | var transitionPrefix;
38 |
39 | /******************************
40 | Public Methods
41 | *******************************/
42 |
43 | var methods = {
44 |
45 | init: function() {
46 | return this.each(function () {
47 | if(methods.getTransitionSupport()) {
48 | transitionSupport = true;
49 | transitionPrefix = methods.getTransitionPrefix();
50 | }
51 |
52 | methods.appendHTML();
53 | methods.setEventHandlers();
54 | methods.initializeItems();
55 | });
56 | },
57 |
58 | /******************************
59 | Append HTML
60 | *******************************/
61 |
62 | appendHTML: function() {
63 | fill.css('background', settings.barColor);
64 |
65 | if(!settings.tooltip) {
66 | toolTip.css('display', 'none');
67 | }
68 | toolTip.text(fillPercentage + settings.symbol);
69 | },
70 |
71 |
72 | /******************************
73 | Set Event Handlers
74 | *******************************/
75 | setEventHandlers: function() {
76 | if(settings.animateOnResize) {
77 | $(window).on("resize", function(event){
78 | clearTimeout(resizeTimeout);
79 | resizeTimeout = setTimeout(function() {
80 | methods.refill();
81 | }, 300);
82 | });
83 | }
84 | },
85 |
86 | /******************************
87 | Initialize
88 | *******************************/
89 |
90 | initializeItems: function() {
91 | var pctWidth = methods.calculateFill(fillPercentage);
92 | object.find('.tipWrap').css({ display: 'inline' });
93 |
94 | if(transitionSupport)
95 | methods.transitionFill(pctWidth);
96 | else
97 | methods.animateFill(pctWidth);
98 | },
99 |
100 | getTransitionSupport: function() {
101 |
102 | var thisBody = document.body || document.documentElement,
103 | thisStyle = thisBody.style;
104 | var support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
105 | return support;
106 | },
107 |
108 | getTransitionPrefix: function() {
109 | if(/mozilla/.test(navigator.userAgent.toLowerCase()) && !/webkit/.test(navigator.userAgent.toLowerCase())) {
110 | return '-moz-transition';
111 | }
112 | if(/webkit/.test(navigator.userAgent.toLowerCase())) {
113 | return '-webkit-transition';
114 | }
115 | if(/opera/.test(navigator.userAgent.toLowerCase())) {
116 | return '-o-transition';
117 | }
118 | if (/msie/.test(navigator.userAgent.toLowerCase())) {
119 | return '-ms-transition';
120 | }
121 | else {
122 | return 'transition';
123 | }
124 | },
125 |
126 | getTransition: function(val, time, type) {
127 |
128 | var CSSObj;
129 | if(type === 'width') {
130 | CSSObj = { width : val };
131 | }
132 | else if (type === 'left') {
133 | CSSObj = { left: val };
134 | }
135 |
136 | time = time/1000;
137 | CSSObj[transitionPrefix] = type+' '+time+'s ease-in-out';
138 | return CSSObj;
139 |
140 | },
141 |
142 | refill: function() {
143 | fill.css('width', 0);
144 | toolTip.css('left', 0);
145 | barWidth = object.width();
146 | methods.initializeItems();
147 | },
148 |
149 | calculateFill: function(percentage) {
150 | percentage = percentage * 0.01;
151 | var finalWidth = barWidth * percentage;
152 | return finalWidth;
153 | },
154 |
155 | transitionFill: function(barWidth) {
156 |
157 | var toolTipOffset = barWidth - toolTip.width();
158 | fill.css( methods.getTransition(barWidth, settings.duration, 'width'));
159 | toolTip.css( methods.getTransition(toolTipOffset, settings.duration, 'left'));
160 |
161 | },
162 |
163 | animateFill: function(barWidth) {
164 | var toolTipOffset = barWidth - toolTip.width();
165 | fill.stop().animate({width: '+=' + barWidth}, settings.duration);
166 | toolTip.stop().animate({left: '+=' + toolTipOffset}, settings.duration);
167 | }
168 |
169 | };
170 |
171 | if (methods[options]) { // $("#element").pluginName('methodName', 'arg1', 'arg2');
172 | return methods[options].apply(this, Array.prototype.slice.call(arguments, 1));
173 | } else if (typeof options === 'object' || !options) { // $("#element").pluginName({ option: 1, option:2 });
174 | return methods.init.apply(this);
175 | } else {
176 | $.error( 'Method "' + method + '" does not exist in barfiller plugin!');
177 | }
178 | };
179 |
180 | })(jQuery);
--------------------------------------------------------------------------------
/inc/elementor-widgets/widgets/statistics.php:
--------------------------------------------------------------------------------
1 | start_controls_section(
48 | 'statistics_contents',
49 | [
50 | 'label' => __( 'Statistics content', 'hostza-companion' ),
51 | ]
52 | );
53 |
54 | $this->add_control(
55 | 'statistics', [
56 | 'label' => __( 'Create New', 'hostza-companion' ),
57 | 'type' => Controls_Manager::REPEATER,
58 | 'title_field' => '{{{ item_title }}}',
59 | 'fields' => [
60 | [
61 | 'name' => 'item_value',
62 | 'label' => __( 'Statistic Value', 'hostza-companion' ),
63 | 'label_block' => true,
64 | 'type' => Controls_Manager::TEXT,
65 | 'default' => __( '278390', 'hostza-companion' ),
66 | ],
67 | [
68 | 'name' => 'item_title',
69 | 'label' => __( 'Item Title', 'hostza-companion' ),
70 | 'label_block' => true,
71 | 'type' => Controls_Manager::TEXT,
72 | 'default' => __( 'Client around the World', 'hostza-companion' ),
73 | ],
74 | ],
75 | 'default' => [
76 | [
77 | 'item_value' => __( '278390', 'hostza-companion' ),
78 | 'item_title' => __( 'Client around the World', 'hostza-companion' ),
79 | ],
80 | [
81 | 'item_value' => __( '200', 'hostza-companion' ),
82 | 'item_title' => __( 'Dedicated team', 'hostza-companion' ),
83 | ],
84 | [
85 | 'item_value' => __( '563278', 'hostza-companion' ),
86 | 'item_title' => __( 'Domain registation', 'hostza-companion' ),
87 | ],
88 | ]
89 | ]
90 | );
91 | $this->end_controls_section(); // End service content
92 |
93 | /**
94 | * Style Tab
95 | * ------------------------------ Style Section Heading ------------------------------
96 | *
97 | */
98 |
99 | $this->start_controls_section(
100 | 'style_room_section', [
101 | 'label' => __( 'Style Service Section', 'hostza-companion' ),
102 | 'tab' => Controls_Manager::TAB_STYLE,
103 | ]
104 | );
105 | $this->add_control(
106 | 'sub_title_col', [
107 | 'label' => __( 'Sub Title Color', 'hostza-companion' ),
108 | 'type' => Controls_Manager::COLOR,
109 | 'selectors' => [
110 | '{{WRAPPER}} .team_area .section_title .sub_heading' => 'color: {{VALUE}};',
111 | ],
112 | ]
113 | );
114 | $this->add_control(
115 | 'big_title_col', [
116 | 'label' => __( 'Big Title Color', 'hostza-companion' ),
117 | 'type' => Controls_Manager::COLOR,
118 | 'selectors' => [
119 | '{{WRAPPER}} .team_area .section_title h3' => 'color: {{VALUE}};',
120 | ],
121 | ]
122 | );
123 |
124 | $this->add_control(
125 | 'member_styles_seperator',
126 | [
127 | 'label' => esc_html__( 'Member Styles', 'hostza-companion' ),
128 | 'type' => Controls_Manager::HEADING,
129 | 'separator' => 'after'
130 | ]
131 | );
132 | $this->add_control(
133 | 'member_name_col', [
134 | 'label' => __( 'Member Name Color', 'hostza-companion' ),
135 | 'type' => Controls_Manager::COLOR,
136 | 'selectors' => [
137 | '{{WRAPPER}} .team_area .single_team h3' => 'color: {{VALUE}};',
138 | ],
139 | ]
140 | );
141 | $this->add_control(
142 | 'member_desig_color', [
143 | 'label' => __( 'Member Designation Color', 'hostza-companion' ),
144 | 'type' => Controls_Manager::COLOR,
145 | 'selectors' => [
146 | '{{WRAPPER}} .team_area .single_team p' => 'color: {{VALUE}};',
147 | ],
148 | ]
149 | );
150 | $this->end_controls_section();
151 |
152 | }
153 |
154 | protected function render() {
155 | $settings = $this->get_settings();
156 | $statistics = !empty( $settings['statistics'] ) ? $settings['statistics'] : '';
157 | ?>
158 |
159 |
160 |
161 |
162 | 0 ) {
164 | foreach( $statistics as $item ) {
165 | $item_value = ( !empty( $item['item_value'] ) ) ? esc_html( $item['item_value'] ) : '';
166 | $item_title = ( !empty( $item['item_title'] ) ) ? esc_html( $item['item_title'] ) : '';
167 | ?>
168 |
169 |
170 | {$item_value}
174 | ";
175 | }
176 | if ( $item_title ) {
177 | echo "
178 |
{$item_title}
179 | ";
180 | }
181 | ?>
182 |
183 |
184 |
188 |
189 |
190 |
191 | start_controls_section(
49 | 'price_table_content',
50 | [
51 | 'label' => __( 'Price Table content', 'hostza-companion' ),
52 | ]
53 | );
54 |
55 | $this->add_control(
56 | 'price_table', [
57 | 'label' => __( 'Create New', 'hostza-companion' ),
58 | 'type' => Controls_Manager::REPEATER,
59 | 'title_field' => '{{{ package_title }}}',
60 | 'fields' => [
61 | [
62 | 'name' => 'package_title',
63 | 'label' => __( 'Package Title', 'hostza-companion' ),
64 | 'label_block' => true,
65 | 'type' => Controls_Manager::TEXT,
66 | 'default' => __( 'Starter', 'hostza-companion' ),
67 | ],
68 | [
69 | 'name' => 'template_id',
70 | 'label' => __( 'Select Elementor Template', 'hostza-companion' ),
71 | 'label_block' => true,
72 | 'type' => Controls_Manager::SELECT,
73 | 'options' => get_elementor_templates(),
74 | ],
75 | ],
76 | 'default' => [
77 | [
78 | 'package_title' => __( 'Starter', 'hostza-companion' ),
79 | ],
80 | [
81 | 'package_title' => __( 'Premium', 'hostza-companion' ),
82 | ],
83 | [
84 | 'package_title' => __( 'Pro', 'hostza-companion' ),
85 | ],
86 | ]
87 | ]
88 | );
89 | $this->end_controls_section(); // End service content
90 |
91 | /**
92 | * Style Tab
93 | * ------------------------------ Style Section Heading ------------------------------
94 | *
95 | */
96 |
97 | $this->start_controls_section(
98 | 'style_room_section', [
99 | 'label' => __( 'Style Pricing Section', 'hostza-companion' ),
100 | 'tab' => Controls_Manager::TAB_STYLE,
101 | ]
102 | );
103 | $this->add_control(
104 | 'first_item_bg_col', [
105 | 'label' => __( 'All Item BG Color', 'hostza-companion' ),
106 | 'type' => Controls_Manager::COLOR,
107 | 'selectors' => [
108 | '{{WRAPPER}} .package_prsing_area .single_prising .prising_header' => 'background: {{VALUE}};',
109 | ],
110 | ]
111 | );
112 | $this->add_control(
113 | 'second_item_bg_col', [
114 | 'label' => __( 'Second Item Bg Color', 'hostza-companion' ),
115 | 'type' => Controls_Manager::COLOR,
116 | 'selectors' => [
117 | '{{WRAPPER}} .package_prsing_area .single_prising .prising_header.deep' => 'background: {{VALUE}};',
118 | ],
119 | ]
120 | );
121 | $this->add_control(
122 | 'third_item_bg_col', [
123 | 'label' => __( 'Third Item Bg Color', 'hostza-companion' ),
124 | 'type' => Controls_Manager::COLOR,
125 | 'selectors' => [
126 | '{{WRAPPER}} .package_prsing_area .single_prising .prising_header.yellow' => 'background: {{VALUE}};',
127 | ],
128 | ]
129 | );
130 | $this->add_control(
131 | 'button_pointer_col', [
132 | 'label' => __( 'List pointer & Button Color', 'hostza-companion' ),
133 | 'type' => Controls_Manager::COLOR,
134 | 'selectors' => [
135 | '{{WRAPPER}} .package_prsing_area .boxed_btn_green' => 'background: {{VALUE}};',
136 | '{{WRAPPER}} .package_prsing_area .single_prising .list ul li::before' => 'background: {{VALUE}};',
137 | '{{WRAPPER}} .package_prsing_area .boxed_btn_green:hover' => 'background: transparent; color: {{VALUE}} !important; border-color: {{VALUE}};',
138 | ],
139 | ]
140 | );
141 |
142 | $this->end_controls_section();
143 |
144 | }
145 |
146 | protected function render() {
147 | $settings = $this->get_settings();
148 | $price_table = !empty( $settings['price_table'] ) ? $settings['price_table'] : '';
149 | ?>
150 |
151 |
152 |
153 | 0 ){
155 | $counter = 0;
156 | foreach ( $price_table as $item ) {
157 | $counter++;
158 | $package_title = !empty( $item['package_title'] ) ? esc_html($item['package_title']) : '';
159 | $template_id = !empty( $item['template_id'] ) ? $item['template_id'] : '';
160 | if ($counter === 1) {
161 | $dynamic_class = 'prising_header';
162 | } else if ($counter === 2) {
163 | $dynamic_class = 'prising_header deep';
164 | } else {
165 | $dynamic_class = 'prising_header yellow';
166 | }
167 | ?>
168 |
169 |
170 |
171 | {$package_title}";
174 | }
175 | ?>
176 |
177 | frontend->get_builder_content( $template_id, false );
179 | ?>
180 |
181 |
182 |
186 |
187 |
188 |
189 | esc_html__( 'Add footer social links.', 'hostza-companion' ), )
28 | );
29 |
30 | }
31 |
32 | // This is where the action happens
33 | public function widget( $args, $instance ) {
34 |
35 | $title = apply_filters( 'widget_title', $instance['title'] );
36 | $desc = apply_filters( 'widget_text', $instance['desc'] );
37 | $facebook = apply_filters( 'widget_text', $instance['facebook'] );
38 | $twitter = apply_filters( 'widget_text', $instance['twitter'] );
39 | $linkedin = apply_filters( 'widget_text', $instance['linkedin'] );
40 | $instagram = apply_filters( 'widget_text', $instance['instagram'] );
41 | $dribbble = apply_filters( 'widget_text', $instance['dribbble'] );
42 |
43 | // before and after widget arguments are defined by themes
44 | echo wp_kses_post( $args['before_widget'] );
45 | if ( ! empty( $title ) )
46 | echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
47 |
48 |
49 | if( $desc ){
50 | echo ''.esc_html( $desc ).'
';
51 | } ?>
52 |
53 |
54 |
';
57 | }
58 | if( $twitter ){
59 | echo '
';
60 | }
61 | if( $dribbble ){
62 | echo '
';
63 | }
64 | if( $linkedin ){
65 | echo '
';
66 | }
67 | if( $instagram ){
68 | echo '
';
69 | }
70 | ?>
71 |
72 |
73 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 | =0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
10 |
--------------------------------------------------------------------------------
/inc/elementor-widgets/widgets/blog.php:
--------------------------------------------------------------------------------
1 | start_controls_section(
50 | 'blog_content',
51 | [
52 | 'label' => __( 'Latest Blog Header Setting', 'hostza-companion' ),
53 | ]
54 | );
55 | $this->add_control(
56 | 'sec_title',
57 | [
58 | 'label' => __( 'Section Title', 'hostza-companion' ),
59 | 'type' => Controls_Manager::TEXT,
60 | 'label_block' => true,
61 | 'default' => __( 'Latest News', 'hostza-companion' )
62 | ]
63 | );
64 | $this->add_control(
65 | 'sub_title',
66 | [
67 | 'label' => __( 'Sub Title', 'hostza-companion' ),
68 | 'type' => Controls_Manager::TEXTAREA,
69 | 'label_block' => true,
70 | 'default' => 'Your domain control panel is designed for ease-of-use and
allows for all aspects of your domains.'
71 | ]
72 | );
73 |
74 | $this->end_controls_section(); // End few words content
75 |
76 | // Blog post settings
77 | $this->start_controls_section(
78 | 'blog_post_sec',
79 | [
80 | 'label' => __( 'Blog Post Settings', 'hostza-companion' ),
81 | ]
82 | );
83 | $this->add_control(
84 | 'post_num',
85 | [
86 | 'label' => esc_html__( 'Post Item', 'hostza-companion' ),
87 | 'type' => Controls_Manager::NUMBER,
88 | 'label_block' => false,
89 | 'default' => absint(3),
90 | 'min' => 1,
91 | 'max' => 6,
92 | ]
93 | );
94 | $this->add_control(
95 | 'post_exc',
96 | [
97 | 'label' => esc_html__( 'Post Excerpt Length', 'hostza-companion' ),
98 | 'type' => Controls_Manager::NUMBER,
99 | 'label_block' => false,
100 | 'default' => absint(13),
101 | 'min' => 5,
102 | 'max' => 20
103 | ]
104 | );
105 | $this->add_control(
106 | 'post_order',
107 | [
108 | 'label' => esc_html__( 'Post Order', 'hostza-companion' ),
109 | 'type' => Controls_Manager::SWITCHER,
110 | 'label_block' => false,
111 | 'label_on' => 'ASC',
112 | 'label_off' => 'DESC',
113 | 'default' => 'yes',
114 | 'options' => [
115 | 'no' => 'ASC',
116 | 'yes' => 'DESC'
117 | ]
118 | ]
119 | );
120 |
121 | $this->end_controls_section(); // End few words content
122 |
123 | //------------------------------ Style Section ------------------------------
124 | $this->start_controls_section(
125 | 'style_section', [
126 | 'label' => __( 'Style Section Heading', 'hostza-companion' ),
127 | 'tab' => Controls_Manager::TAB_STYLE,
128 | ]
129 | );
130 | $this->add_control(
131 | 'color_secttitle', [
132 | 'label' => __( 'Section Title Color', 'hostza-companion' ),
133 | 'type' => Controls_Manager::COLOR,
134 | 'selectors' => [
135 | '{{WRAPPER}} .latest_new_area .section_title h3' => 'color: {{VALUE}};',
136 | ],
137 | ]
138 | );
139 | $this->add_control(
140 | 'color_sec_sub_title', [
141 | 'label' => __( 'Sub Title Color', 'hostza-companion' ),
142 | 'type' => Controls_Manager::COLOR,
143 | 'selectors' => [
144 | '{{WRAPPER}} .latest_new_area .section_title p' => 'color: {{VALUE}};',
145 | ],
146 | ]
147 | );
148 | $this->add_control(
149 | 'color_blog_cat', [
150 | 'label' => __( 'Blog Category Color', 'hostza-companion' ),
151 | 'type' => Controls_Manager::COLOR,
152 | 'selectors' => [
153 | '{{WRAPPER}} .latest_new_area .single_news .news_content .news_meta a' => 'color: {{VALUE}};',
154 | ],
155 | ]
156 | );
157 | $this->add_control(
158 | 'color_blog_title', [
159 | 'label' => __( 'Blog Title Color', 'hostza-companion' ),
160 | 'type' => Controls_Manager::COLOR,
161 | 'selectors' => [
162 | '{{WRAPPER}} .latest_new_area .single_news .news_content h3 a' => 'color: {{VALUE}};',
163 | ],
164 | ]
165 | );
166 | $this->add_control(
167 | 'color_blog_title_hover', [
168 | 'label' => __( 'Blog Title Hover Color', 'hostza-companion' ),
169 | 'type' => Controls_Manager::COLOR,
170 | 'selectors' => [
171 | '{{WRAPPER}} .latest_new_area .single_news .news_content h3 a:hover' => 'color: {{VALUE}};',
172 | ],
173 | ]
174 | );
175 |
176 | $this->end_controls_section();
177 |
178 | }
179 |
180 | protected function render() {
181 |
182 | $settings = $this->get_settings();
183 | $sec_title = !empty( $settings['sec_title'] ) ? esc_html($settings['sec_title']) : '';
184 | $sub_title = !empty( $settings['sub_title'] ) ? wp_kses_post(nl2br($settings['sub_title'])) : '';
185 | $post_num = !empty( $settings['post_num'] ) ? $settings['post_num'] : '';
186 | $post_exc = !empty( $settings['post_exc'] ) ? $settings['post_exc'] : '';
187 | $post_order = !empty( $settings['post_order'] ) ? $settings['post_order'] : '';
188 | $post_order = $post_order == 'yes' ? 'DESC' : 'ASC';
189 | ?>
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | {$sec_title}";
200 | }
201 | if ( $sub_title ) {
202 | echo "
{$sub_title}
";
203 | }
204 | ?>
205 |
206 |
207 |
208 |
209 |
214 |
215 |
216 |
217 |
218 | start_controls_section(
47 | 'simple_contact_content',
48 | [
49 | 'label' => __( 'Simple Contact Section', 'hostza-companion' ),
50 | ]
51 | );
52 | $this->add_control(
53 | 'sec_title',
54 | [
55 | 'label' => __( 'Section Title', 'hostza-companion' ),
56 | 'type' => Controls_Manager::TEXT,
57 | 'label_block' => true,
58 | 'default' => __( 'Have any Question?', 'hostza-companion' ),
59 | ]
60 | );
61 | $this->add_control(
62 | 'chat_btn',
63 | [
64 | 'label' => __( 'Chat Button Label', 'hostza-companion' ),
65 | 'type' => Controls_Manager::TEXT,
66 | 'label_block' => true,
67 | 'default' => __( 'Live Chat', 'hostza-companion' ),
68 | ]
69 | );
70 | $this->add_control(
71 | 'chat_btn_url',
72 | [
73 | 'label' => __( 'Chat Button URL', 'hostza-companion' ),
74 | 'type' => Controls_Manager::URL,
75 | 'label_block' => true,
76 | ]
77 | );
78 | $this->add_control(
79 | 'start_btn',
80 | [
81 | 'label' => __( 'Start Button Label', 'hostza-companion' ),
82 | 'type' => Controls_Manager::TEXT,
83 | 'label_block' => true,
84 | 'default' => __( 'get start now', 'hostza-companion' ),
85 | ]
86 | );
87 | $this->add_control(
88 | 'start_btn_url',
89 | [
90 | 'label' => __( 'Start Button URL', 'hostza-companion' ),
91 | 'type' => Controls_Manager::URL,
92 | 'label_block' => true,
93 | ]
94 | );
95 | $this->end_controls_section(); // End service content
96 |
97 | //------------------------------ Style title ------------------------------
98 |
99 | // Top Section Styles
100 | $this->start_controls_section(
101 | 'simple_contact_sec_style', [
102 | 'label' => __( 'Simple Contact Section Styles', 'hostza-companion' ),
103 | 'tab' => Controls_Manager::TAB_STYLE,
104 | ]
105 | );
106 |
107 | $this->add_control(
108 | 'sec_title_col', [
109 | 'label' => __( 'Title Color', 'hostza-companion' ),
110 | 'type' => Controls_Manager::COLOR,
111 | 'selectors' => [
112 | '{{WRAPPER}} .have_question h3' => 'color: {{VALUE}};',
113 | ],
114 | ]
115 | );
116 |
117 | $this->add_control(
118 | 'btn1_bg_col', [
119 | 'label' => __( 'Button 1 Color', 'hostza-companion' ),
120 | 'type' => Controls_Manager::COLOR,
121 | 'selectors' => [
122 | '{{WRAPPER}} .have_question .chat .boxed_btn_green' => 'background: {{VALUE}};',
123 | '{{WRAPPER}} .have_question .chat .boxed_btn_green:hover' => 'background: transparent; border-color: {{VALUE}}; color: {{VALUE}} !important;',
124 | ],
125 | ]
126 | );
127 | $this->add_control(
128 | 'btn1_hover_col', [
129 | 'label' => __( 'Button 1 Hover Color', 'hostza-companion' ),
130 | 'type' => Controls_Manager::COLOR,
131 | 'selectors' => [
132 | '{{WRAPPER}} .have_question .chat .boxed_btn_green:hover' => 'background: transparent; border-color: {{VALUE}}; color: {{VALUE}} !important;',
133 | ],
134 | ]
135 | );
136 |
137 | $this->add_control(
138 | 'btn2_bg_col', [
139 | 'label' => __( 'Button 2 Color', 'hostza-companion' ),
140 | 'type' => Controls_Manager::COLOR,
141 | 'selectors' => [
142 | '{{WRAPPER}} .have_question .chat .boxed_btn_green2' => 'color: {{VALUE}} !important; border-color: {{VALUE}} !important',
143 | '{{WRAPPER}} .have_question .chat .boxed_btn_green2:hover' => 'border-color: {{VALUE}} !important; background: {{VALUE}}; color: #fff !important',
144 | ],
145 | ]
146 | );
147 | $this->add_control(
148 | 'btn2_hover_col', [
149 | 'label' => __( 'Button 2 Hover Color', 'hostza-companion' ),
150 | 'type' => Controls_Manager::COLOR,
151 | 'selectors' => [
152 | '{{WRAPPER}} .have_question .chat .boxed_btn_green2:hover' => 'border-color: {{VALUE}} !important; background: {{VALUE}}; color: #fff !important',
153 | ],
154 | ]
155 | );
156 |
157 | $this->end_controls_section();
158 | }
159 |
160 | protected function render() {
161 | $settings = $this->get_settings();
162 | $sec_title = !empty( $settings['sec_title'] ) ? $settings['sec_title'] : '';
163 | $chat_btn = !empty( $settings['chat_btn'] ) ? $settings['chat_btn'] : '';
164 | $chat_btn_url = !empty( $settings['chat_btn_url']['url'] ) ? $settings['chat_btn_url']['url'] : '';
165 | $start_btn = !empty( $settings['start_btn'] ) ? $settings['start_btn'] : '';
166 | $start_btn_url = !empty( $settings['start_btn_url']['url'] ) ? $settings['start_btn_url']['url'] : '';
167 | ?>
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 | {$sec_title}";
179 | }
180 | ?>
181 |
182 |
183 |
184 |
188 |
189 |
{$chat_btn}
190 | ";
191 | }
192 | if ( $start_btn ) {
193 | echo "
194 |
195 | {$start_btn}
196 | ";
197 | }
198 | ?>
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 | start_controls_section(
48 | 'faq_tab_item_contents',
49 | [
50 | 'label' => __( 'Faq tab item content', 'hostza-companion' ),
51 | ]
52 | );
53 |
54 | $this->add_control(
55 | 'faq_items', [
56 | 'label' => __( 'Create New', 'hostza-companion' ),
57 | 'type' => Controls_Manager::REPEATER,
58 | 'title_field' => '{{{ faq_title }}}',
59 | 'fields' => [
60 | [
61 | 'name' => 'faq_title',
62 | 'label' => __( 'Faq Title', 'hostza-companion' ),
63 | 'label_block' => true,
64 | 'type' => Controls_Manager::TEXTAREA,
65 | 'default' => 'What are the advantages of WordPress hosting over shared?',
66 | ],
67 | [
68 | 'name' => 'faq_text',
69 | 'label' => __( 'Faq Text', 'hostza-companion' ),
70 | 'label_block' => true,
71 | 'type' => Controls_Manager::TEXTAREA,
72 | 'default' => 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our let god moving. Moving in fourth air night bring upon',
73 | ],
74 | ],
75 | 'default' => [
76 | [
77 | 'faq_title' => 'What are the advantages of WordPress hosting over shared?',
78 | 'faq_text' => 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our
79 | let god moving. Moving in fourth air night bring upon',
80 | ],
81 | [
82 | 'faq_title' => 'Will you transfer my site?',
83 | 'faq_text' => 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our
84 | let god moving. Moving in fourth air night bring upon',
85 | ],
86 | [
87 | 'faq_title' => 'Why should I host with Hostza?',
88 | 'faq_text' => 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our
89 | let god moving. Moving in fourth air night bring upon',
90 | ],
91 | [
92 | 'faq_title' => 'How do I get started with Shared Hosting?',
93 | 'faq_text' => 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our
94 | let god moving. Moving in fourth air night bring upon',
95 | ],
96 | [
97 | 'faq_title' => 'Is WordPress hosting worth it?',
98 | 'faq_text' => 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our
99 | let god moving. Moving in fourth air night bring upon',
100 | ],
101 | ]
102 | ]
103 | );
104 | $this->end_controls_section(); // End service content
105 |
106 | /**
107 | * Style Tab
108 | * ------------------------------ Style Section Heading ------------------------------
109 | *
110 | */
111 |
112 | $this->start_controls_section(
113 | 'style_room_section', [
114 | 'label' => __( 'Style Service Section', 'hostza-companion' ),
115 | 'tab' => Controls_Manager::TAB_STYLE,
116 | ]
117 | );
118 | $this->add_control(
119 | 'sub_title_col', [
120 | 'label' => __( 'Sub Title Color', 'hostza-companion' ),
121 | 'type' => Controls_Manager::COLOR,
122 | 'selectors' => [
123 | '{{WRAPPER}} .team_area .section_title .sub_heading' => 'color: {{VALUE}};',
124 | ],
125 | ]
126 | );
127 | $this->add_control(
128 | 'big_title_col', [
129 | 'label' => __( 'Big Title Color', 'hostza-companion' ),
130 | 'type' => Controls_Manager::COLOR,
131 | 'selectors' => [
132 | '{{WRAPPER}} .team_area .section_title h3' => 'color: {{VALUE}};',
133 | ],
134 | ]
135 | );
136 |
137 | $this->add_control(
138 | 'member_styles_seperator',
139 | [
140 | 'label' => esc_html__( 'Member Styles', 'hostza-companion' ),
141 | 'type' => Controls_Manager::HEADING,
142 | 'separator' => 'after'
143 | ]
144 | );
145 | $this->add_control(
146 | 'member_name_col', [
147 | 'label' => __( 'Member Name Color', 'hostza-companion' ),
148 | 'type' => Controls_Manager::COLOR,
149 | 'selectors' => [
150 | '{{WRAPPER}} .team_area .single_team h3' => 'color: {{VALUE}};',
151 | ],
152 | ]
153 | );
154 | $this->add_control(
155 | 'member_desig_color', [
156 | 'label' => __( 'Member Designation Color', 'hostza-companion' ),
157 | 'type' => Controls_Manager::COLOR,
158 | 'selectors' => [
159 | '{{WRAPPER}} .team_area .single_team p' => 'color: {{VALUE}};',
160 | ],
161 | ]
162 | );
163 | $this->end_controls_section();
164 |
165 | }
166 |
167 | protected function render() {
168 | $settings = $this->get_settings();
169 | $faq_items = !empty( $settings['faq_items'] ) ? $settings['faq_items'] : '';
170 |
171 | if( is_array( $faq_items ) && count( $faq_items ) > 0 ) {
172 | $i = 0;
173 | foreach( $faq_items as $item ) {
174 | $i++;
175 | $faq_id = ( !empty( $item['_id'] ) ) ? esc_attr($item['_id']) : '';
176 | $faq_title = ( !empty( $item['faq_title'] ) ) ? wp_kses_post( nl2br( $item['faq_title'] ) ) : '';
177 | $faq_text = ( !empty( $item['faq_text'] ) ) ? wp_kses_post( nl2br( $item['faq_text'] ) ) : '';
178 | ?>
179 |
192 | start_controls_section(
48 | 'support_right_content',
49 | [
50 | 'label' => __( 'Support Content', 'hostza-companion' ),
51 | ]
52 | );
53 |
54 | $this->add_control(
55 | 'bg_img',
56 | [
57 | 'label' => esc_html__( 'BG Image', 'hostza-companion' ),
58 | 'type' => Controls_Manager::MEDIA,
59 | 'label_block' => true,
60 | 'default' => [
61 | 'url' => Utils::get_placeholder_image_src(),
62 | ],
63 | ]
64 | );
65 | $this->add_control(
66 | 'sec_title',
67 | [
68 | 'label' => esc_html__( 'Section Title', 'hostza-companion' ),
69 | 'type' => Controls_Manager::TEXT,
70 | 'label_block' => true,
71 | 'default' => '24h Dedicated Support',
72 | ]
73 | );
74 | $this->add_control(
75 | 'sec_text',
76 | [
77 | 'label' => esc_html__( 'Section Text', 'hostza-companion' ),
78 | 'type' => Controls_Manager::TEXTAREA,
79 | 'label_block' => true,
80 | 'default' => 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our let god moving. Moving in fourth air night bring upon you’re it beast.',
81 | ]
82 | );
83 | $this->add_control(
84 | 'btn_text',
85 | [
86 | 'label' => esc_html__( 'Button Text', 'hostza-companion' ),
87 | 'type' => Controls_Manager::TEXT,
88 | 'label_block' => true,
89 | 'default' => esc_html__( 'Get Start Now', 'hostza-companion' ),
90 | ]
91 | );
92 | $this->add_control(
93 | 'btn_url',
94 | [
95 | 'label' => esc_html__( 'Button URL', 'hostza-companion' ),
96 | 'type' => Controls_Manager::URL,
97 | 'label_block' => true,
98 | 'default' => [
99 | 'url' => '#'
100 | ],
101 | ]
102 | );
103 | $this->add_control(
104 | 'phone_number',
105 | [
106 | 'label' => esc_html__( 'Phone Number', 'hostza-companion' ),
107 | 'type' => Controls_Manager::TEXT,
108 | 'label_block' => true,
109 | 'default' => esc_html__( '+10 267 367 678 2678', 'hostza-companion' ),
110 | ]
111 | );
112 |
113 |
114 | $this->end_controls_section(); // End support_section
115 |
116 | //------------------------------ Style title ------------------------------
117 |
118 | // Top Section Styles
119 | $this->start_controls_section(
120 | 'left_sec_style', [
121 | 'label' => __( 'Top Section Styles', 'hostza-companion' ),
122 | 'tab' => Controls_Manager::TAB_STYLE,
123 | ]
124 | );
125 |
126 | $this->add_control(
127 | 'sec_title_col', [
128 | 'label' => __( 'Big Title Color', 'hostza-companion' ),
129 | 'type' => Controls_Manager::COLOR,
130 | 'selectors' => [
131 | '{{WRAPPER}} .dedicated_support .support_info h3' => 'color: {{VALUE}};',
132 | ],
133 | ]
134 | );
135 |
136 | $this->add_control(
137 | 'text_col', [
138 | 'label' => __( 'Text Color', 'hostza-companion' ),
139 | 'type' => Controls_Manager::COLOR,
140 | 'selectors' => [
141 | '{{WRAPPER}} .dedicated_support .support_info p' => 'color: {{VALUE}};',
142 | ],
143 | ]
144 | );
145 |
146 | $this->add_control(
147 | 'btn_phn_col', [
148 | 'label' => __( 'Button & Phone Text Color', 'hostza-companion' ),
149 | 'type' => Controls_Manager::COLOR,
150 | 'selectors' => [
151 | '{{WRAPPER}} .dedicated_support .support_info .get_started a' => 'background: {{VALUE}};',
152 | '{{WRAPPER}} .dedicated_support .support_info .get_started .phone_num' => 'background: none; color: {{VALUE}};',
153 | '{{WRAPPER}} .dedicated_support .support_info .get_started .boxed_btn_green:hover' => 'background: transparent; color: {{VALUE}} !important; border-color:{{VALUE}} ',
154 | ],
155 | ]
156 | );
157 |
158 | $this->add_control(
159 | 'btn_phn_hover_col', [
160 | 'label' => __( 'Button & Phone Hover Color', 'hostza-companion' ),
161 | 'type' => Controls_Manager::COLOR,
162 | 'selectors' => [
163 | '{{WRAPPER}} .dedicated_support .support_info .get_started .boxed_btn_green:hover' => 'background: transparent; color: {{VALUE}} !important; border-color:{{VALUE}} ',
164 | '{{WRAPPER}} .dedicated_support .support_info .get_started .phone_num:hover' => 'color: {{VALUE}};',
165 | ],
166 | ]
167 | );
168 |
169 | $this->end_controls_section();
170 |
171 | }
172 |
173 | protected function render() {
174 | $settings = $this->get_settings();
175 | $bg_img = !empty( $settings['bg_img']['url'] ) ? esc_url($settings['bg_img']['url']) : '';
176 | $sec_title = !empty( $settings['sec_title'] ) ? esc_html($settings['sec_title']) : '';
177 | $sec_text = !empty( $settings['sec_text'] ) ? esc_html($settings['sec_text']) : '';
178 | $btn_text = !empty( $settings['btn_text'] ) ? esc_html($settings['btn_text']) : '';
179 | $btn_url = !empty( $settings['btn_url']['url'] ) ? esc_url($settings['btn_url']['url']) : '';
180 | $phone_number = !empty( $settings['phone_number'] ) ? esc_html($settings['phone_number']) : '';
181 | $tel_url = 'tel:' . trim( $phone_number );
182 | ?>
183 |
184 |
185 | >
186 |
187 |
188 |
189 |
190 | {$sec_title}";
193 | }
194 | if ( $sec_text ) {
195 | echo "
{$sec_text}
";
196 | }
197 | ?>
198 |
199 | {$btn_text}";
202 | }
203 | if ( $phone_number ) {
204 | echo "
{$phone_number}";
205 | }
206 | ?>
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 | esc_html__( 'Add footer about content', 'hostza-companion' ), )
34 | );
35 |
36 | }
37 |
38 | // This is where the action happens
39 | public function widget( $args, $instance ) {
40 |
41 | $title = apply_filters( 'widget_title', $instance['title'] );
42 | $image = apply_filters( 'widget_image', $instance['image'] );
43 | $textarea = apply_filters( 'widget_textarea', $instance['textarea'] );
44 |
45 | // before and after widget arguments are defined by themes
46 | echo wp_kses_post( $args['before_widget'] );
47 | if ( ! empty( $title ) )
48 | echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
49 |
50 |
51 | ?>
52 |
70 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
128 |
129 |
162 |
230 | start_controls_section(
49 | 'contact_info',
50 | [
51 | 'label' => __( 'Contact Info', 'hostza-companion' ),
52 | ]
53 | );
54 |
55 | $this->add_control(
56 | 'info', [
57 | 'label' => __( 'Create Contact Info', 'hostza-companion' ),
58 | 'type' => Controls_Manager::REPEATER,
59 | 'title_field' => '{{{ label }}}',
60 | 'fields' => [
61 | [
62 | 'name' => 'label',
63 | 'label' => __( 'Contact Info', 'hostza-companion' ),
64 | 'label_block' => true,
65 | 'type' => Controls_Manager::TEXT,
66 | 'default' => esc_html__( 'Dhaka, Bangladesh', 'hostza-companion' )
67 | ],
68 | [
69 | 'name' => 'desc',
70 | 'label' => __( 'Contact Descriptions', 'hostza-companion' ),
71 | 'type' => Controls_Manager::TEXTAREA,
72 | 'default' => esc_html__( 'Write something...', 'hostza-companion' )
73 | ],
74 | [
75 | 'name' => 'icon',
76 | 'label' => __( 'Icon', 'hostza-companion' ),
77 | 'type' => Controls_Manager::ICON,
78 | ]
79 |
80 | ],
81 | 'default' => [
82 | [
83 | 'label' => esc_html__( 'Buttonwood, California.', 'hostza-companion' ),
84 | 'desc' => esc_html__( 'Rosemead, CA 91770', 'hostza-companion' ),
85 | 'icon' => 'fa fa-home',
86 | ],
87 | [
88 | 'label' => esc_html__( '00 (440) 9865 562', 'hostza-companion' ),
89 | 'desc' => esc_html__( 'Mon to Fri 9am to 6pm', 'hostza-companion' ),
90 | 'icon' => 'fa fa-tablet',
91 | ],
92 | [
93 | 'label' => esc_html__( 'support@colorlib.com', 'hostza-companion' ),
94 | 'desc' => esc_html__( 'Send us your query anytime!', 'hostza-companion' ),
95 | 'icon' => 'fa fa-envelope-o',
96 | ],
97 | ]
98 | ]
99 | );
100 |
101 | $this->end_controls_section(); // End Contact Info
102 |
103 | // ---------------------------------------- Contact Form ------------------------------
104 | $this->start_controls_section(
105 | 'contact_form',
106 | [
107 | 'label' => __( 'Contact Form', 'hostza-companion' ),
108 | ]
109 | );
110 | $this->add_control(
111 | 'contact_form_title',
112 | [
113 | 'label' => esc_html__( 'Contact Form Title', 'hostza-companion' ),
114 | 'type' => Controls_Manager::TEXT,
115 | 'label_block' => true,
116 | 'default' => esc_html__('Get in Touch', 'hostza-companion')
117 | ]
118 | );
119 | $this->add_control(
120 | 'contact_formshortcode',
121 | [
122 | 'label' => esc_html__( 'Form Shortcode', 'hostza-companion' ),
123 | 'type' => Controls_Manager::TEXT,
124 | 'label_block' => true
125 | ]
126 | );
127 | $this->end_controls_section(); // End Contact Form
128 |
129 |
130 | /**
131 | * Style Tab
132 | * ------------------------------ Style ------------------------------
133 | *
134 | */
135 | $this->start_controls_section(
136 | 'style_content_color', [
137 | 'label' => __( 'Style Content Color', 'hostza-companion' ),
138 | 'tab' => Controls_Manager::TAB_STYLE,
139 | ]
140 | );
141 |
142 | $this->add_control(
143 | 'color_title', [
144 | 'label' => __( 'Right Text Title Color', 'hostza-companion' ),
145 | 'type' => Controls_Manager::COLOR,
146 | 'default' => '#2a2a2a',
147 | 'selectors' => [
148 | '{{WRAPPER}} .contact-info .media-body h3' => 'color: {{VALUE}};',
149 | ],
150 | ]
151 | );
152 | $this->add_control(
153 | 'color_desc', [
154 | 'label' => __( 'Right Text Sub Title Color', 'hostza-companion' ),
155 | 'type' => Controls_Manager::COLOR,
156 | 'default' => '#8a8a8a',
157 | 'selectors' => [
158 | '{{WRAPPER}} .contact-info .media-body p' => 'color: {{VALUE}};',
159 | ],
160 | ]
161 | );
162 | $this->add_control(
163 | 'color_icon', [
164 | 'label' => __( 'Icon Color', 'hostza-companion' ),
165 | 'type' => Controls_Manager::COLOR,
166 | 'default' => '#8f9195',
167 | 'selectors' => [
168 | '{{WRAPPER}} .contact-info__icon i, .contact-info__icon span' => 'color: {{VALUE}};',
169 | ],
170 | ]
171 | );
172 |
173 | $this->end_controls_section();
174 |
175 |
176 | }
177 |
178 | protected function render() {
179 |
180 | $settings = $this->get_settings();
181 |
182 |
183 | ?>
184 |
223 |
224 |
17 |
18 |
19 |
20 |
21 | ' . esc_html( $subtitle ) . '';
25 | }
26 | // Title
27 | if ( $title ) {
28 | echo '
' . esc_html( $title ) . '
';
29 | }
30 | ?>
31 |
32 |
33 |
34 |
35 |
66 |
67 | ';
70 | }
71 | ?>
72 |
73 |
74 | 'h4',
79 | 'text' => esc_html( $val['title'] )
80 | )
81 | );
82 | }
83 |
84 | if( !empty( $val['sub-title-url'] ) && !empty( $val['sub-title'] ) ){
85 | echo '
'.esc_html( $val['sub-title'] ).'';
86 | }else{
87 | echo '
'.esc_html( $val['sub-title'] ).'
';
88 | }
89 | ?>
90 |
91 |
92 |
93 |
94 |
95 | $target_post_id->ID,
118 | 'post_status' => $type,
119 | );
120 |
121 | if ( $message == true ) {
122 | // Update the post/page
123 | $update_status = wp_update_post( $target_post, true );
124 | } else {
125 | // Update the post/page
126 | $update_status = wp_update_post( $target_post, false );
127 | }
128 |
129 | return $update_status;
130 | }
131 |
132 |
133 |
134 | // Course - Custom Post Type
135 | function hostza_custom_posts() {
136 | $labels = array(
137 | 'name' => _x( 'Courses', 'post type general name', 'hostza-companion' ),
138 | 'singular_name' => _x( 'Course', 'post type singular name', 'hostza-companion' ),
139 | 'menu_name' => _x( 'Courses', 'admin menu', 'hostza-companion' ),
140 | 'name_admin_bar' => _x( 'Course', 'add new on admin bar', 'hostza-companion' ),
141 | 'add_new' => _x( 'Add New', 'course', 'hostza-companion' ),
142 | 'add_new_item' => __( 'Add New Course', 'hostza-companion' ),
143 | 'new_item' => __( 'New Course', 'hostza-companion' ),
144 | 'edit_item' => __( 'Edit Course', 'hostza-companion' ),
145 | 'view_item' => __( 'View Course', 'hostza-companion' ),
146 | 'all_items' => __( 'All Courses', 'hostza-companion' ),
147 | 'search_items' => __( 'Search Courses', 'hostza-companion' ),
148 | 'parent_item_colon' => __( 'Parent Courses:', 'hostza-companion' ),
149 | 'not_found' => __( 'No courses found.', 'hostza-companion' ),
150 | 'not_found_in_trash' => __( 'No courses found in Trash.', 'hostza-companion' )
151 | );
152 |
153 | $args = array(
154 | 'labels' => $labels,
155 | 'description' => __( 'Description.', 'hostza-companion' ),
156 | 'public' => true,
157 | 'publicly_queryable' => true,
158 | 'show_ui' => true,
159 | 'show_in_menu' => true,
160 | 'query_var' => true,
161 | 'rewrite' => array( 'slug' => 'course' ),
162 | 'capability_type' => 'post',
163 | 'has_archive' => true,
164 | 'hierarchical' => false,
165 | 'menu_position' => null,
166 | 'supports' => array( 'title', 'editor', 'thumbnail' )
167 | );
168 |
169 | register_post_type( 'course', $args );
170 |
171 | }
172 | add_action( 'init', 'hostza_custom_posts' );
173 |
174 |
175 |
176 | /*=========================================================
177 | Courses Section
178 | ========================================================*/
179 | function hostza_course_section( $pNumber = 3 ){
180 | $courses = new WP_Query( array(
181 | 'post_type' => 'course',
182 | 'posts_per_page'=> $pNumber,
183 |
184 | ) );
185 |
186 | if( $courses->have_posts() ) {
187 | while ( $courses->have_posts() ) {
188 | $courses->the_post();
189 | $course_img = get_the_post_thumbnail( get_the_id(), 'hostza_order_thumb_360x300', '', array( 'alt' => get_the_title() ) );
190 | $course_fee = ! empty( hostza_meta( 'course_fee') ) ? hostza_meta( 'course_fee') : 'N/A';
191 | ?>
192 |
193 |
194 |
199 |
200 |
201 |
202 |
203 |
204 | 'course',
218 | 'posts_per_page' => $pnumber,
219 |
220 | ) );
221 |
222 | ?>
223 |
224 |
257 | start_controls_section(
48 | 'lets_launch_content',
49 | [
50 | 'label' => __( 'Lets Launch Content', 'hostza-companion' ),
51 | ]
52 | );
53 |
54 | $this->add_control(
55 | 'bg_img',
56 | [
57 | 'label' => esc_html__( 'BG Image', 'hostza-companion' ),
58 | 'type' => Controls_Manager::MEDIA,
59 | 'label_block' => true,
60 | 'default' => [
61 | 'url' => Utils::get_placeholder_image_src(),
62 | ],
63 | ]
64 | );
65 | $this->add_control(
66 | 'sec_title',
67 | [
68 | 'label' => esc_html__( 'Section Title', 'hostza-companion' ),
69 | 'type' => Controls_Manager::TEXT,
70 | 'label_block' => true,
71 | 'default' => __( 'Lets\'s Launch Your Website Now', 'hostza-companion' ),
72 | ]
73 | );
74 | $this->add_control(
75 | 'sub_title',
76 | [
77 | 'label' => esc_html__( 'Sub Title', 'hostza-companion' ),
78 | 'type' => Controls_Manager::TEXTAREA,
79 | 'label_block' => true,
80 | 'default' => 'Our set he for firmament morning sixth subdue darkness creeping gathered divide our let god moving.
Moving in fourth air night bring upon you’re it beast.',
81 | ]
82 | );
83 | $this->add_control(
84 | 'btn1_text',
85 | [
86 | 'label' => __( 'Button1 Text', 'hostza-companion' ),
87 | 'type' => Controls_Manager::TEXT,
88 | 'label_block' => true,
89 | 'default' => __( 'Live Chat', 'hostza-companion' ),
90 | ]
91 | );
92 | $this->add_control(
93 | 'btn1_url',
94 | [
95 | 'label' => __( 'Button URL', 'hostza-companion' ),
96 | 'type' => Controls_Manager::URL,
97 | 'label_block' => true,
98 | 'default' => [
99 | 'url' => '#'
100 | ],
101 | ]
102 | );
103 | $this->add_control(
104 | 'btn2_text',
105 | [
106 | 'label' => __( 'Button2 Text', 'hostza-companion' ),
107 | 'type' => Controls_Manager::TEXT,
108 | 'label_block' => true,
109 | 'default' => __( 'get start now', 'hostza-companion' ),
110 | ]
111 | );
112 | $this->add_control(
113 | 'btn2_url',
114 | [
115 | 'label' => __( 'Button2 URL', 'hostza-companion' ),
116 | 'type' => Controls_Manager::URL,
117 | 'label_block' => true,
118 | 'default' => [
119 | 'url' => '#'
120 | ],
121 | ]
122 | );
123 |
124 |
125 | $this->end_controls_section(); // End support_section
126 |
127 | //------------------------------ Style title ------------------------------
128 |
129 | // Top Section Styles
130 | $this->start_controls_section(
131 | 'left_sec_style', [
132 | 'label' => __( 'Top Section Styles', 'hostza-companion' ),
133 | 'tab' => Controls_Manager::TAB_STYLE,
134 | ]
135 | );
136 |
137 | $this->add_control(
138 | 'sec_title_col', [
139 | 'label' => __( 'Big Title Color', 'hostza-companion' ),
140 | 'type' => Controls_Manager::COLOR,
141 | 'selectors' => [
142 | '{{WRAPPER}} .lets_launch .launch_text h3' => 'color: {{VALUE}};',
143 | ],
144 | ]
145 | );
146 |
147 | $this->add_control(
148 | 'text_col', [
149 | 'label' => __( 'Text Color', 'hostza-companion' ),
150 | 'type' => Controls_Manager::COLOR,
151 | 'selectors' => [
152 | '{{WRAPPER}} .lets_launch .launch_text p' => 'color: {{VALUE}};',
153 | ],
154 | ]
155 | );
156 |
157 | $this->add_control(
158 | 'btn1_bg_col', [
159 | 'label' => __( 'Button 1 Color', 'hostza-companion' ),
160 | 'type' => Controls_Manager::COLOR,
161 | 'selectors' => [
162 | '{{WRAPPER}} .lets_launch .launch_text .chat .boxed_btn_green' => 'background: {{VALUE}};',
163 | '{{WRAPPER}} .lets_launch .launch_text .chat .boxed_btn_green:hover' => 'background: transparent; border-color: {{VALUE}}; color: {{VALUE}} !important;',
164 | ],
165 | ]
166 | );
167 | $this->add_control(
168 | 'btn1_hover_col', [
169 | 'label' => __( 'Button 1 Hover Color', 'hostza-companion' ),
170 | 'type' => Controls_Manager::COLOR,
171 | 'selectors' => [
172 | '{{WRAPPER}} .lets_launch .launch_text .chat .boxed_btn_green:hover' => 'background: transparent; border-color: {{VALUE}}; color: {{VALUE}} !important;',
173 | ],
174 | ]
175 | );
176 |
177 | $this->add_control(
178 | 'btn2_bg_col', [
179 | 'label' => __( 'Button 2 Color', 'hostza-companion' ),
180 | 'type' => Controls_Manager::COLOR,
181 | 'selectors' => [
182 | '{{WRAPPER}} .lets_launch .launch_text .chat .boxed_btn_green2' => 'color: {{VALUE}} !important; border-color: {{VALUE}} !important',
183 | '{{WRAPPER}} .lets_launch .launch_text .chat .boxed_btn_green2:hover' => 'border-color: {{VALUE}} !important; background: {{VALUE}}; color: #fff !important',
184 | ],
185 | ]
186 | );
187 | $this->add_control(
188 | 'btn2_hover_col', [
189 | 'label' => __( 'Button 2 Hover Color', 'hostza-companion' ),
190 | 'type' => Controls_Manager::COLOR,
191 | 'selectors' => [
192 | '{{WRAPPER}} .lets_launch .launch_text .chat .boxed_btn_green2:hover' => 'border-color: {{VALUE}} !important; background: {{VALUE}}; color: #fff !important',
193 | ],
194 | ]
195 | );
196 |
197 | $this->end_controls_section();
198 |
199 | }
200 |
201 | protected function render() {
202 | $settings = $this->get_settings();
203 | $bg_img = !empty( $settings['bg_img']['url'] ) ? esc_url($settings['bg_img']['url']) : '';
204 | $sec_title = !empty( $settings['sec_title'] ) ? esc_html($settings['sec_title']) : '';
205 | $sub_title = !empty( $settings['sub_title'] ) ? wp_kses_post(nl2br($settings['sub_title'])) : '';
206 | $btn1_text = !empty( $settings['btn1_text'] ) ? esc_html( $settings['btn1_text'] ) : '';
207 | $btn1_url = !empty( $settings['btn1_url']['url'] ) ? esc_url( $settings['btn1_url']['url'] ) : '';
208 | $btn2_text = !empty( $settings['btn2_text'] ) ? esc_html( $settings['btn2_text'] ) : '';
209 | $btn2_url = !empty( $settings['btn2_url']['url'] ) ? esc_url( $settings['btn2_url']['url'] ) : '';
210 | ?>
211 |
212 |
213 | >
214 |
215 | {$sec_title}";
218 | }
219 | if ( $sub_title ) {
220 | echo "
{$sub_title}
";
221 | }
222 | ?>
223 |
224 |
227 |
228 |
{$btn1_text}";
229 | }
230 | if ( $btn2_text ) {
231 | echo "
232 | {$btn2_text}";
233 | }
234 | ?>
235 |
236 |
237 |
238 |
239 | start_controls_section(
48 | 'video_left_content',
49 | [
50 | 'label' => __( 'Video Left Content', 'hostza-companion' ),
51 | ]
52 | );
53 | $this->add_control(
54 | 'sub_title',
55 | [
56 | 'label' => esc_html__( 'Sub Title', 'hostza-companion' ),
57 | 'type' => Controls_Manager::TEXT,
58 | 'label_block' => true,
59 | 'default' => esc_html__( 'How We Work', 'hostza-companion' ),
60 | ]
61 | );
62 | $this->add_control(
63 | 'sec_title',
64 | [
65 | 'label' => esc_html__( 'Section Title', 'hostza-companion' ),
66 | 'type' => Controls_Manager::TEXTAREA,
67 | 'label_block' => true,
68 | 'default' => 'Watch the Video
How we Work?',
69 | ]
70 | );
71 | $this->add_control(
72 | 'sec_text',
73 | [
74 | 'label' => esc_html__( 'Section Text', 'hostza-companion' ),
75 | 'type' => Controls_Manager::TEXTAREA,
76 | 'label_block' => true,
77 | 'default' => 'Inspires employees and organizations to support causes they care
about. We do this to bring more resources to the nonprofits that are
changing our world.',
78 | ]
79 | );
80 | $this->add_control(
81 | 'btn_text',
82 | [
83 | 'label' => esc_html__( 'Button Text', 'hostza-companion' ),
84 | 'type' => Controls_Manager::TEXT,
85 | 'label_block' => true,
86 | 'default' => esc_html__( 'Book Now', 'hostza-companion' ),
87 | ]
88 | );
89 | $this->add_control(
90 | 'btn_url',
91 | [
92 | 'label' => esc_html__( 'Button URL', 'hostza-companion' ),
93 | 'type' => Controls_Manager::URL,
94 | 'label_block' => true,
95 | 'default' => [
96 | 'url' => '#'
97 | ],
98 | ]
99 | );
100 |
101 | $this->end_controls_section(); // End about us content
102 |
103 | // Right section
104 | $this->start_controls_section(
105 | 'video_section_content',
106 | [
107 | 'label' => __( 'Video Section', 'hostza-companion' ),
108 | ]
109 | );
110 | $this->add_control(
111 | 'video_thumb',
112 | [
113 | 'label' => esc_html__( 'Video Thumbnail', 'hostza-companion' ),
114 | 'type' => Controls_Manager::MEDIA,
115 | 'label_block' => true,
116 | 'default' => [
117 | 'url' => Utils::get_placeholder_image_src(),
118 | ]
119 | ]
120 | );
121 | $this->add_control(
122 | 'video_url',
123 | [
124 | 'label' => esc_html__( 'Popup Video URL', 'hostza-companion' ),
125 | 'type' => Controls_Manager::URL,
126 | 'label_block' => true,
127 | 'default' => [
128 | 'url' => 'https://www.youtube.com/watch?v=E_-lMZDi7Uw'
129 | ],
130 | ]
131 | );
132 |
133 |
134 | $this->end_controls_section(); // End video_section
135 |
136 | //------------------------------ Style title ------------------------------
137 |
138 | // Top Section Styles
139 | $this->start_controls_section(
140 | 'left_sec_style', [
141 | 'label' => __( 'Top Section Styles', 'hostza-companion' ),
142 | 'tab' => Controls_Manager::TAB_STYLE,
143 | ]
144 | );
145 |
146 | $this->add_control(
147 | 'sec_title_col', [
148 | 'label' => __( 'Big Title Color', 'hostza-companion' ),
149 | 'type' => Controls_Manager::COLOR,
150 | 'selectors' => [
151 | '{{WRAPPER}} .home_contact h2' => 'color: {{VALUE}};',
152 | ],
153 | ]
154 | );
155 |
156 | $this->add_control(
157 | 'sub_title_col', [
158 | 'label' => __( 'Sub title Color', 'hostza-companion' ),
159 | 'type' => Controls_Manager::COLOR,
160 | 'selectors' => [
161 | '{{WRAPPER}} .home_contact p' => 'color: {{VALUE}};',
162 | ],
163 | ]
164 | );
165 |
166 | $this->add_control(
167 | 'btn_bg_col', [
168 | 'label' => __( 'Button BG Color', 'hostza-companion' ),
169 | 'type' => Controls_Manager::COLOR,
170 | 'selectors' => [
171 | '{{WRAPPER}} .home_contact .btn_1' => 'background: {{VALUE}};',
172 | ],
173 | ]
174 | );
175 |
176 | $this->add_control(
177 | 'btn_hov_bg_col', [
178 | 'label' => __( 'Button Hover Bg Color', 'hostza-companion' ),
179 | 'type' => Controls_Manager::COLOR,
180 | 'selectors' => [
181 | '{{WRAPPER}} .home_contact .btn_1:hover' => 'background-color: {{VALUE}};',
182 | ],
183 | ]
184 | );
185 | $this->add_control(
186 | 'bg_overlay_col', [
187 | 'label' => __( 'Bg Overlay Color', 'hostza-companion' ),
188 | 'type' => Controls_Manager::COLOR,
189 | 'selectors' => [
190 | '{{WRAPPER}} .home_contact:after' => 'background: {{VALUE}};',
191 | ],
192 | ]
193 | );
194 | $this->end_controls_section();
195 |
196 | }
197 |
198 | protected function render() {
199 | $settings = $this->get_settings();
200 | $sub_title = !empty( $settings['sub_title'] ) ? esc_html($settings['sub_title']) : '';
201 | $sec_title = !empty( $settings['sec_title'] ) ? wp_kses_post(nl2br($settings['sec_title'])) : '';
202 | $sec_text = !empty( $settings['sec_text'] ) ? wp_kses_post(nl2br($settings['sec_text'])) : '';
203 | $btn_text = !empty( $settings['btn_text'] ) ? esc_html($settings['btn_text']) : '';
204 | $btn_url = !empty( $settings['btn_url']['url'] ) ? esc_url($settings['btn_url']['url']) : '';
205 | $video_thumb = !empty( $settings['video_thumb']['id'] ) ? wp_get_attachment_image( $settings['video_thumb']['id'], 'hostza_video_thumb_877x750', '', array( 'alt' => $sec_title.' image' ) ) : '';
206 | $video_url = !empty( $settings['video_url']['url'] ) ? esc_url($settings['video_url']['url']) : '';
207 | ?>
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 | {$sub_title}";
220 | }
221 | if ( $sec_title ) {
222 | echo "
{$sub_title}
";
223 | }
224 | ?>
225 |
226 | {$sec_text}";
229 | }
230 | if ( $btn_text ) {
231 | echo "
{$btn_text}";
232 | }
233 | ?>
234 |
235 |
236 |
237 |
238 |
239 |
240 |
246 |
247 | ";
248 | }
249 | ?>
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 | \
189 | \
190 | \
191 | ');
192 |
193 | self.$node.append($YTPlayerString);
194 | self.$YTPlayerString = $YTPlayerString;
195 | $YTPlayerString = null;
196 | },
197 |
198 | /**
199 | * @function createBackgroundVideo
200 | * Adds HTML for video background
201 | */
202 | createBackgroundVideo: function createBackgroundVideo() {
203 | /*jshint multistr: true */
204 | var self = this,
205 | $YTPlayerString = $('\
208 | ');
209 |
210 | self.$node.append($YTPlayerString);
211 | self.$YTPlayerString = $YTPlayerString;
212 | $YTPlayerString = null;
213 | },
214 |
215 | /**
216 | * @function resize
217 | * Resize event to change video size
218 | */
219 | resize: function resize(self) {
220 | //var self = this;
221 | var container = $(window);
222 |
223 | if (!self.options.fitToBackground) {
224 | container = self.$node;
225 | }
226 |
227 | var width = container.width(),
228 | pWidth, // player width, to be defined
229 | height = container.height(),
230 | pHeight, // player height, tbd
231 | $YTPlayerPlayer = $('#' + self.holderID);
232 |
233 | // when screen aspect ratio differs from video, video must center and underlay one dimension
234 | if (width / self.options.ratio < height) {
235 | pWidth = Math.ceil(height * self.options.ratio); // get new player width
236 | $YTPlayerPlayer.width(pWidth).height(height).css({
237 | left: (width - pWidth) / 2,
238 | top: 0
239 | }); // player width is greater, offset left; reset top
240 | } else { // new video width < window width (gap to right)
241 | pHeight = Math.ceil(width / self.options.ratio); // get new player height
242 | $YTPlayerPlayer.width(width).height(pHeight).css({
243 | left: 0,
244 | top: (height - pHeight) / 2
245 | }); // player height is greater, offset top; reset left
246 | }
247 |
248 | $YTPlayerPlayer = null;
249 | container = null;
250 | },
251 |
252 | /**
253 | * @function onYouTubeIframeAPIReady
254 | * @ params {object} YTPlayer object for access to options
255 | * Youtube API calls this function when the player is ready.
256 | */
257 | onYouTubeIframeAPIReady: function onYouTubeIframeAPIReady() {
258 | var self = this;
259 | self.player = new window.YT.Player(self.holderID, self.options);
260 | },
261 |
262 | /**
263 | * @function onPlayerReady
264 | * @ params {event} window event from youtube player
265 | */
266 | onPlayerReady: function onPlayerReady(e) {
267 | if (this.options.mute) {
268 | e.target.mute();
269 | }
270 | e.target.playVideo();
271 | },
272 |
273 | /**
274 | * @function getPlayer
275 | * returns youtube player
276 | */
277 | getPlayer: function getPlayer() {
278 | return this.player;
279 | },
280 |
281 | /**
282 | * @function destroy
283 | * destroys all!
284 | */
285 | destroy: function destroy() {
286 | var self = this;
287 |
288 | self.$node
289 | .removeData('yt-init')
290 | .removeData('ytPlayer')
291 | .removeClass('loaded');
292 |
293 | self.$YTPlayerString.remove();
294 |
295 | $(window).off('resize.YTplayer' + self.ID);
296 | $(window).off('scroll.YTplayer' + self.ID);
297 | self.$body = null;
298 | self.$node = null;
299 | self.$YTPlayerString = null;
300 | self.player.destroy();
301 | self.player = null;
302 | }
303 | };
304 |
305 | // Scroll Stopped event.
306 | $.fn.scrollStopped = function(callback) {
307 | var $this = $(this), self = this;
308 | $this.scroll(function(){
309 | if ($this.data('scrollTimeout')) {
310 | clearTimeout($this.data('scrollTimeout'));
311 | }
312 | $this.data('scrollTimeout', setTimeout(callback,250,self));
313 | });
314 | };
315 |
316 | // Create plugin
317 | $.fn.YTPlayer = function(options) {
318 |
319 | return this.each(function() {
320 | var el = this;
321 |
322 | $(el).data("yt-init", true);
323 | var player = Object.create(YTPlayer);
324 | player.init(el, options);
325 | $.data(el, "ytPlayer", player);
326 | });
327 | };
328 |
329 | })(jQuery, window, document);
--------------------------------------------------------------------------------
/inc/elementor-widgets/widgets/core-features.php:
--------------------------------------------------------------------------------
1 | start_controls_section(
49 | 'core_feature_content',
50 | [
51 | 'label' => __( 'Core Features content', 'hostza-companion' ),
52 | ]
53 | );
54 | $this->add_control(
55 | 'sec_title',
56 | [
57 | 'label' => esc_html__( 'Section Title', 'hostza-companion' ),
58 | 'type' => Controls_Manager::TEXT,
59 | 'label_block' => true,
60 | 'default' => esc_html__( 'Core Features', 'hostza-companion' )
61 | ]
62 | );
63 |
64 | $this->add_control(
65 | 'tab_content_seperator',
66 | [
67 | 'label' => esc_html__( 'Tab Header Items', 'hostza-companion' ),
68 | 'type' => Controls_Manager::HEADING,
69 | 'separator' => 'after'
70 | ]
71 | );
72 |
73 | $this->add_control(
74 | 'tab_content', [
75 | 'label' => __( 'Create New', 'hostza-companion' ),
76 | 'type' => Controls_Manager::REPEATER,
77 | 'title_field' => '{{{ tab_title }}}',
78 | 'fields' => [
79 | [
80 | 'name' => 'tab_title',
81 | 'label' => __( 'Tab Title', 'hostza-companion' ),
82 | 'label_block' => true,
83 | 'type' => Controls_Manager::TEXT,
84 | 'default' => __( 'Features', 'hostza-companion' ),
85 | ],
86 | [
87 | 'name' => 'template_id',
88 | 'label' => __( 'Select Elementor Template', 'hostza-companion' ),
89 | 'label_block' => true,
90 | 'type' => Controls_Manager::SELECT,
91 | 'options' => get_elementor_templates(),
92 | ],
93 | ],
94 | 'default' => [
95 | [
96 | 'tab_title' => __( 'Features', 'hostza-companion' ),
97 | ],
98 | [
99 | 'tab_title' => __( 'Advanced Features', 'hostza-companion' ),
100 | ],
101 | ]
102 | ]
103 | );
104 | $this->end_controls_section(); // End service content
105 |
106 | /**
107 | * Style Tab
108 | * ------------------------------ Style Section Heading ------------------------------
109 | *
110 | */
111 |
112 | $this->start_controls_section(
113 | 'style_room_section', [
114 | 'label' => __( 'Style Core Features Section', 'hostza-companion' ),
115 | 'tab' => Controls_Manager::TAB_STYLE,
116 | ]
117 | );
118 | $this->add_control(
119 | 'first_icon_col', [
120 | 'label' => __( 'First Icon Color', 'hostza-companion' ),
121 | 'type' => Controls_Manager::COLOR,
122 | 'selectors' => [
123 | '{{WRAPPER}} .core_features .tab-pane .row .col-xl-6:first-child .icon' => 'color: {{VALUE}};',
124 | ],
125 | ]
126 | );
127 | $this->add_control(
128 | 'first_icon_bg_col', [
129 | 'label' => __( 'First Icon Bg Color', 'hostza-companion' ),
130 | 'type' => Controls_Manager::COLOR,
131 | 'selectors' => [
132 | '{{WRAPPER}} .core_features .tab-pane .row .col-xl-6:first-child .icon' => 'background: {{VALUE}};',
133 | ],
134 | ]
135 | );
136 | $this->add_control(
137 | 'second_icon_col', [
138 | 'label' => __( 'Second Icon Color', 'hostza-companion' ),
139 | 'type' => Controls_Manager::COLOR,
140 | 'selectors' => [
141 | '{{WRAPPER}} .core_features .tab-pane .row .col-xl-6:nth-child(2) .icon' => 'color: {{VALUE}};',
142 | ],
143 | ]
144 | );
145 | $this->add_control(
146 | 'second_icon_bg_col', [
147 | 'label' => __( 'Second Icon Bg Color', 'hostza-companion' ),
148 | 'type' => Controls_Manager::COLOR,
149 | 'selectors' => [
150 | '{{WRAPPER}} .core_features .tab-pane .row .col-xl-6:nth-child(2) .icon' => 'background: {{VALUE}};',
151 | ],
152 | ]
153 | );
154 | $this->add_control(
155 | 'third_icon_col', [
156 | 'label' => __( 'Third Icon Color', 'hostza-companion' ),
157 | 'type' => Controls_Manager::COLOR,
158 | 'selectors' => [
159 | '{{WRAPPER}} .core_features .tab-pane .row .col-xl-6:nth-child(3) .icon' => 'color: {{VALUE}};',
160 | ],
161 | ]
162 | );
163 | $this->add_control(
164 | 'third_icon_bg_col', [
165 | 'label' => __( 'Third Icon Bg Color', 'hostza-companion' ),
166 | 'type' => Controls_Manager::COLOR,
167 | 'selectors' => [
168 | '{{WRAPPER}} .core_features .tab-pane .row .col-xl-6:nth-child(3) .icon' => 'background: {{VALUE}};',
169 | ],
170 | ]
171 | );
172 | $this->add_control(
173 | 'fourth_icon_col', [
174 | 'label' => __( 'Fourth Icon Color', 'hostza-companion' ),
175 | 'type' => Controls_Manager::COLOR,
176 | 'selectors' => [
177 | '{{WRAPPER}} .core_features .tab-pane .row .col-xl-6:last-child .icon' => 'color: {{VALUE}};',
178 | ],
179 | ]
180 | );
181 | $this->add_control(
182 | 'fourth_icon_bg_col', [
183 | 'label' => __( 'Fourth Icon Bg Color', 'hostza-companion' ),
184 | 'type' => Controls_Manager::COLOR,
185 | 'selectors' => [
186 | '{{WRAPPER}} .core_features .tab-pane .row .col-xl-6:last-child .icon' => 'background: {{VALUE}};',
187 | ],
188 | ]
189 | );
190 |
191 | $this->end_controls_section();
192 |
193 | }
194 |
195 | protected function render() {
196 | $settings = $this->get_settings();
197 | $sec_title = !empty( $settings['sec_title'] ) ? $settings['sec_title'] : '';
198 | $tab_items = !empty( $settings['tab_content'] ) ? $settings['tab_content'] : '';
199 | ?>
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 | {$sec_title}";
211 | }
212 | ?>
213 |
214 |
215 |
242 |
243 |
244 |
245 |
246 |
247 |
254 |
255 | frontend->get_builder_content( $template_id, false );
257 | ?>
258 |
259 |
263 |
264 |
265 |
266 |
267 |
268 |