Beispiel #1
0
 public function pagelink($page)
 {
     global $wp_rewrite;
     $prettyurls = $wp_rewrite->using_permalinks();
     $alpha = false !== preg_match('/([a-z]|0\\-9)/', $page);
     $namespace = get_class_property(get_class($this), 'namespace');
     $prettyurl = "{$namespace}/{$this->slug}" . ($page > 1 || $alpha ? "/page/{$page}" : "");
     // Handle catalog landing page category pagination
     if (is_catalog_frontpage()) {
         $prettyurl = $page > 1 || $alpha ? "page/{$page}" : "";
     }
     $queryvars = array($this->taxonomy => $this->uri);
     if ($page > 1 || $alpha) {
         $queryvars['paged'] = $page;
     }
     return apply_filters('shopp_paged_link', Shopp::url($prettyurls ? user_trailingslashit($prettyurl) : $queryvars, false), $page);
 }
Beispiel #2
0
 public function content($content)
 {
     global $wp_query;
     // Test that this is the main query and it is a catalog page
     if (!$wp_query->is_main_query() || !is_catalog_frontpage()) {
         return $content;
     }
     shopp_debug('Displaying catalog page request: ' . $_SERVER['REQUEST_URI']);
     ob_start();
     locate_shopp_template(array('catalog.php'), true);
     $content = ob_get_clean();
     return apply_filters('shopp_catalog_template', $content);
 }
Beispiel #3
0
 /**
  * Checks if the current page is the catalog on the front page of the site
  *
  * @api `shopp('storefront.is-frontpage')`
  * @since 1.1
  *
  * @param string          $result  The output
  * @param array           $options The options
  * @param ShoppStorefront $O       The working object
  * @return bool True if it is the frontpage page, false otherwise
  **/
 public static function is_frontpage($result, $options, $O)
 {
     return is_catalog_frontpage();
 }