Exemplo n.º 1
0
 /**
  * Featured Slider array creation
  *
  * @since Biography 1.0.0
  *
  * @param null
  * @return array
  */
 function biography_home_testimonial_array()
 {
     global $biography_customizer_saved_options;
     $biography_home_testimonial_contents_array = array();
     $biography_home_testimonial_contents_array[0]['biography-home-testimonial-title'] = __('Sayer Name, CEO', 'biography');
     $biography_home_testimonial_contents_array[0]['biography-home-testimonial-image'] = get_template_directory_uri() . '/assets/img/sayer.jpg';
     $biography_home_testimonial_contents_array[0]['biography-home-testimonial-content'] = __("The set doesn't moved. Deep don't fru it fowl gathering heaven days moving creeping under from i air. Set it fifth Meat was darkness. every bring in it.", 'biography');
     $biography_home_testimonial_posts[0]['biography-home-testimonial-pages-ids'] = $biography_customizer_saved_options['biography-home-testimonial-page-1'];
     $biography_home_testimonial_posts[1]['biography-home-testimonial-pages-ids'] = $biography_customizer_saved_options['biography-home-testimonial-page-2'];
     $biography_home_testimonial_posts[2]['biography-home-testimonial-pages-ids'] = $biography_customizer_saved_options['biography-home-testimonial-page-3'];
     $biography_home_testimonial_posts_ids = array();
     if (null != $biography_home_testimonial_posts) {
         foreach ($biography_home_testimonial_posts as $biography_home_testimonial_post) {
             if (0 != $biography_home_testimonial_post['biography-home-testimonial-pages-ids']) {
                 $biography_home_testimonial_posts_ids[] = $biography_home_testimonial_post['biography-home-testimonial-pages-ids'];
             }
         }
         if (!empty($biography_home_testimonial_posts_ids)) {
             $biography_home_testimonial_args = array('post_type' => 'page', 'post__in' => $biography_home_testimonial_posts_ids, 'posts_per_page' => 3, 'orderby' => 'post__in');
         }
     }
     // the query
     if (!empty($biography_home_testimonial_args)) {
         $biography_home_testimonial_contents_array = array();
         $biography_home_testimonial_post_query = new WP_Query($biography_home_testimonial_args);
         if ($biography_home_testimonial_post_query->have_posts()) {
             $i = 0;
             while ($biography_home_testimonial_post_query->have_posts()) {
                 $biography_home_testimonial_post_query->the_post();
                 $url = get_template_directory_uri() . '/assets/img/sayer-no-image.jpg';
                 if (has_post_thumbnail()) {
                     $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'thumbnail');
                     $url = $thumb['0'];
                 }
                 $biography_home_testimonial_contents_array[$i]['biography-home-testimonial-title'] = get_the_title();
                 $biography_home_testimonial_contents_array[$i]['biography-home-testimonial-image'] = $url;
                 $biography_home_testimonial_contents_array[$i]['biography-home-testimonial-content'] = biography_words_count(30, get_the_content());
                 $i++;
             }
             wp_reset_postdata();
         }
     }
     return $biography_home_testimonial_contents_array;
 }
Exemplo n.º 2
0
    /**
     * Featured Slider
     *
     * @since Biography 1.0.0
     *
     * @param null
     * @return null
     *
     */
    function biography_home_review()
    {
        global $biography_customizer_saved_options;
        if (1 != $biography_customizer_saved_options['biography-home-review-enable']) {
            return null;
        }
        ?>
        <section class="wrapper wrap-about">
            <div class="container">
                <div class="col-md-6">
                    <?php 
        $biography_home_about_page_id = $biography_customizer_saved_options['biography-home-about-page-id'];
        if (0 != $biography_home_about_page_id) {
            // the query
            $biography_fs_args = array('page_id' => $biography_home_about_page_id);
            $biography_fs_post_query = new WP_Query($biography_fs_args);
            if ($biography_fs_post_query->have_posts()) {
                while ($biography_fs_post_query->have_posts()) {
                    $biography_fs_post_query->the_post();
                    ?>
                                <div class="block-title">
                                    <h2><?php 
                    the_title();
                    ?>
</h2>
                                    <div class="title-divider"><span></span></div>
                                </div>
                                <div class="about-content">
                                    <?php 
                    $content = biography_words_count(50, get_the_content());
                    echo '<p>' . wp_kses_post($content) . "</p>";
                    ?>
                                    <div class="btn-container">
                                        <a class="button button-link" href="<?php 
                    the_permalink();
                    ?>
">
                                            <?php 
                    _e('Read More', 'biography');
                    ?>
                                        </a>
                                    </div>
                                </div>
                                <?php 
                }
                wp_reset_postdata();
            } else {
                biography_home_about_default();
            }
        } else {
            biography_home_about_default();
        }
        ?>
                </div>
                <div class="col-md-6">
                    <?php 
        do_action('biography_action_home_testimonial');
        ?>
                </div>
            </div>
        </section>
        <?php 
    }
Exemplo n.º 3
0
 /**
  * Featured Slider array creation
  *
  * @since Biography 1.0.0
  *
  * @param null
  * @return array
  */
 function biography_home_service_array()
 {
     global $biography_customizer_saved_options;
     $biography_home_service_contents_array = array();
     $biography_home_service_contents_array[0]['biography-home-service-title'] = __('Web Developing', 'biography');
     $biography_home_service_contents_array[0]['biography-home-service-content'] = __("Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.", 'biography');
     $biography_home_service_contents_array[0]['biography-home-service-link'] = '#';
     $biography_home_service_contents_array[0]['biography-home-service-icon'] = 'fa-desktop';
     $biography_home_service_contents_array[1]['biography-home-service-title'] = __('Photography', 'biography');
     $biography_home_service_contents_array[1]['biography-home-service-content'] = __("Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.", 'biography');
     $biography_home_service_contents_array[1]['biography-home-service-link'] = '#';
     $biography_home_service_contents_array[1]['biography-home-service-icon'] = 'fa-camera-retro';
     $biography_home_service_contents_array[2]['biography-home-service-title'] = __('Customer Support', 'biography');
     $biography_home_service_contents_array[2]['biography-home-service-content'] = __("Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.", 'biography');
     $biography_home_service_contents_array[2]['biography-home-service-link'] = '#';
     $biography_home_service_contents_array[2]['biography-home-service-icon'] = 'fa-rocket';
     $biography_icons_arrays = array();
     $biography_home_service_args = array();
     $biography_home_service_posts = array();
     $biography_home_service_posts[0]['biography-home-service-pages-ids'] = $biography_customizer_saved_options['biography-home-service-page-1'];
     $biography_home_service_posts[1]['biography-home-service-pages-ids'] = $biography_customizer_saved_options['biography-home-service-page-2'];
     $biography_home_service_posts[2]['biography-home-service-pages-ids'] = $biography_customizer_saved_options['biography-home-service-page-3'];
     $biography_home_service_posts[0]['biography-home-service-page-icon'] = $biography_customizer_saved_options['biography-home-service-icon-1'];
     $biography_home_service_posts[1]['biography-home-service-page-icon'] = $biography_customizer_saved_options['biography-home-service-icon-2'];
     $biography_home_service_posts[2]['biography-home-service-page-icon'] = $biography_customizer_saved_options['biography-home-service-icon-3'];
     $biography_home_service_posts_ids = array();
     if (null != $biography_home_service_posts) {
         foreach ($biography_home_service_posts as $biography_home_service_post) {
             if (isset($biography_home_service_post['biography-home-service-pages-ids']) && 0 != $biography_home_service_post['biography-home-service-pages-ids']) {
                 $biography_home_service_posts_ids[] = $biography_home_service_post['biography-home-service-pages-ids'];
                 if (isset($biography_home_service_post['biography-home-service-page-icon'])) {
                     $biography_home_service_page_icon = $biography_home_service_post['biography-home-service-page-icon'];
                 } else {
                     $biography_home_service_page_icon = ' fa-desktop';
                 }
                 $biography_icons_arrays[] = $biography_home_service_page_icon;
             }
         }
         if (!empty($biography_home_service_posts_ids)) {
             $biography_home_service_args = array('post_type' => 'page', 'post__in' => $biography_home_service_posts_ids, 'posts_per_page' => 3, 'orderby' => 'post__in');
         }
     }
     // the query
     if (!empty($biography_home_service_args)) {
         $biography_home_service_contents_array = array();
         /*again empty array*/
         $biography_home_service_post_query = new WP_Query($biography_home_service_args);
         if ($biography_home_service_post_query->have_posts()) {
             $i = 0;
             while ($biography_home_service_post_query->have_posts()) {
                 $biography_home_service_post_query->the_post();
                 $biography_home_service_contents_array[$i]['biography-home-service-title'] = get_the_title();
                 $biography_home_service_contents_array[$i]['biography-home-service-content'] = biography_words_count(30, get_the_content());
                 $biography_home_service_contents_array[$i]['biography-home-service-link'] = get_permalink();
                 if (isset($biography_icons_arrays[$i])) {
                     $biography_home_service_contents_array[$i]['biography-home-service-icon'] = $biography_icons_arrays[$i];
                 } else {
                     $biography_home_service_contents_array[$i]['biography-home-service-icon'] = 'fa-desktop';
                 }
                 $i++;
             }
             wp_reset_postdata();
         }
     }
     return $biography_home_service_contents_array;
 }