Esempio n. 1
0
 /**
  * Load Search
  */
 public function fruitframeProductsSearchHook()
 {
     ob_start();
     $query = Greenevolution_Products_Search::init()->getSearchQuery();
     if (is_object($query) && $query->have_posts()) {
         while ($query->have_posts()) {
             $query->the_post();
             $GLOBALS['article'] = $GLOBALS['post'];
             fruitframe_template_part('product');
         }
     } else {
         get_template_part('_notfound', 'search');
     }
     $page = max(1, intval(greenevolution_get_search_value('page')));
     $html = ob_get_clean();
     ob_start();
     /**
      * @todo вынести пагинацию
      * Greenevolution_Products_Search::init()->getPagination();
      */
     greenevolution_pagination(site_url('?s=' . $_REQUEST['s'] . '&page='), $query->max_num_pages, $page);
     $pagination = ob_get_clean();
     exit(json_encode(array('html' => $html, 'pagination' => $pagination, 'page' => $page)));
 }
Esempio n. 2
0
        echo $template_title ? '<div class="hero-home-title">' . $template_title . '</div>' : '';
        echo $template_subtitle ? '<div class="hero-home-subtitle">' . $template_subtitle . '</div>' : '';
        echo $template_description ? '<p class="hero-description">' . $template_description . '</p>' : '';
        echo $hero_button_txt && $hero_button_url ? '<a href="' . $hero_button_url . '" class="major-btn-orange major-btn-orange-light tabby-button">' . $hero_button_txt . '</a>' : '';
        break;
    case 'contact':
        echo $template_title ? '<div class="banner-contact"><h1 class="page-title">' . $template_title . '</h1>' : '';
        echo $template_subtitle ? '<p class="hero-description">' . $template_subtitle . '</p>' : '';
        echo $template_map_title && $template_map_link ? '<a class="map-it" title="' . $template_map_title . '" target="_blank" rel="nofollow" href="' . $template_map_link . '">' . $template_map_title . '<span class="icon-arrow-right"></span></a></div>' : '</div>';
        break;
    case 'single_product':
        echo '<div class="product-hero-block">';
        echo '<div class="left-hero-block">';
        echo $template_title ? '<h1 class="page-title">' . $template_title . '</h1>' : '';
        echo $template_subtitle ? '<p class="hero-description">' . $template_subtitle . '</p>' : '';
        echo '</div>';
        fruitframe_template_part('single-product-header-right');
        echo '</div>';
        echo '</div>';
        break;
    case 'singular':
    case 'blog':
    case 'taxonomy':
    case '404':
        echo $template_title ? '<h1 class="page-title">' . $template_title . '</h1>' : '';
        echo $template_subtitle ? '<p class="hero-description">' . $template_subtitle . '</p>' : '';
        break;
    default:
        break;
}
echo '</div></div></div>';