Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

I made a Woocommerce template for bunnypresslite

$
0
0

Replies: 0

Hello!

I made a experimental Woocommerce template for bunnypresslite

header.php

<?php 
if ( function_exists('is_woocommerce') && is_woocommerce() ) 
    @woocommerce_breadcrumb( ); // https://ru.wordpress.org/plugins/woocommerce-breadcrumbs/  
else
    if( bunnypresslite_display_breadcrumb() != '3' ) get_template_part( 'inc/breadcrumb' );
?>

woocommerce.php

<?php

if( is_single() ) 
	define("PAGE_TYPE", "product");
else
	define("PAGE_TYPE", "shop");

get_header(); ?>

<div class="contents">
	<div  <?php post_class('page'); ?>>
		<article itemscope itemtype="https://schema.org/WebPage">

<?php woocommerce_content(); ?>

		</article>
	</div>
</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

EN:

breadcrumb theme works well for categories, posts and pages. I checked.

I tried to use a theme for woocommerce for the sake of experiment.
the layout of the columns in the woocommerce.php file works well for me.
store main and category are displayed normally.

it is unclear why “product” does not work as “single” in breadcrumb.php.
on the product page breadcrumb.php is not working. does not display anything.
if (is_single()) works with woocommerce. if yes – product, if not – category. I made themes with different sidebars for products and categories using “PAGE_TYPE”.

for woocommerce I usually use the plugin https://ru.wordpress.org/plugins/woocommerce-breadcrumbs/
the easiest way is to add “woocommerce-breadcrumbs” to header.php
if you do not add – then you need to understand why the product does not work as “single” in breadcrumb.php. if you’re interested.

* * *

RU:

breadcrumb темы работает хорошо для категорий, записей и страниц. я проверил.

я попробовал ради эксперимента использовать тему для woocommerce.
вёрстка колонок в файле woocommerce.php у меня работает хорошо.
главная магазина и категория отображаются нормально.

непонятно почему товар “product” не работает как “single” в breadcrumb.php.
на странице товара breadcrumb.php не работает. ничего не отображает.
if ( is_single() ) работает с woocommerce. если да – товар, если нет категория. я делал темы с разными sidebar для товаров и категорий используя “PAGE_TYPE”.

для woocommerce я обычно использую плагин https://ru.wordpress.org/plugins/woocommerce-breadcrumbs/
самый простой способ – добавить “woocommerce-breadcrumbs” в header.php
если не добавлять – тогда надо вникать почему товар не работает как “single” в breadcrumb.php. если это вам интересно.


Viewing all articles
Browse latest Browse all 59525

Trending Articles