Версия WordPress 5.1.1
Версия WP-Recall 16.17.8
Версия Commerce (Магазин) 6.0.0
------------
Как сделать, чтобы в поиске по категориям и меткам:
и
, отображалось, как ЗДЕСЬ
Это наверное нужно Style.css править? Куда нужно добавить и что нужно добавить?
Я создала файлы в корень сайта
archive-products.php
taxonomy-prodcat.php
taxonomy-product_tag.php
------
Куда писать этот код?
<div class="products-box type-slab">
<div class="products-list">
<?php while ( have_posts() ) : the_post(); ?>
<?php include RCL_PATH.'https://karate-wkf.ru/wp-content/plugins/wp-recall/add-on/commerce/templates/product-slab.php'; ?>
<?php endwhile; ?>
</div>
</div>
Otshelnik-Fm сказал(а)
Это должно быть внутри ваших файлов. Вы же их не пустыми создали. Вот найдите где там выводится в цикле have_posts и вписывайте туда.
Сперва создала пустыми, мотом просто вписала в них тот код выше и в корень сайта закинула.
Это файл в корне сайта archive.php и в нём несколько have_posts
<?php
/**
* The archive template file
*
* @package Graphene
* @since Graphene 1.1.5
*/
get_header();
?>
<?php if(function_exists('the_views')) { the_views(); } ?>
<?php
/* Queue the first post, that way we know
* what date we're dealing with (if that is the case).
*
* We reset this later so we can run the loop
* properly with a call to rewind_posts().
*/
if ( have_posts() )
the_post();
?>
<h1 class="page-title archive-title">
<?php if ( is_day() ) : ?>
<?php printf( __( '%s archive', 'graphene' ), '<span>' . get_the_date() . '</span>' ); ?>
<?php elseif ( is_month() ) : ?>
<?php printf( __( '%s archive', 'graphene' ),
/* translators: F will be replaced with month, and Y will be replaced with year, so "F Y" in English would be replaced with something like "June 2008". */
'<span>' . get_the_date( __( 'F Y', 'graphene' ) ) . '</span>' ); ?>
<?php elseif ( is_year() ) : ?>
<?php printf(__( '%s archive', 'graphene' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); ?>
<?php else : ?>
<?php _e( 'Blog Archive', 'graphene' ); ?>
<?php endif; ?>
</h1>
<div class="entries-wrapper">
<?php
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
/* Run the loop for the archives page to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-archives.php and that will be used instead.
*/
while ( have_posts() ) {
the_post();
graphene_get_template_part( 'loop', 'archive' );
}
?>
</div>
<?php graphene_posts_nav(); ?>
<?php get_footer(); ?>
Во всех трёх файлах (они лежат в корне сайта) сейчас написала код ниже
archive-products.php
taxonomy-prodcat.php
taxonomy-product_tag.php
<?php
get_header();
?>
<?php if(function_exists('the_views')) { the_views(); } ?>
<?php
if ( have_posts() )
the_post();
?>
<h1 class="page-title archive-title">
<?php if ( is_day() ) : ?>
<?php printf( __( '%s archive', 'graphene' ), '<span>' . get_the_date() . '</span>' ); ?>
<?php elseif ( is_month() ) : ?>
<?php printf( __( '%s archive', 'graphene' ), '<span>' . get_the_date( __( 'F Y', 'graphene' ) ) . '</span>' ); ?>
<?php elseif ( is_year() ) : ?>
<?php printf(__( '%s archive', 'graphene' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); ?>
<?php else : ?>
<?php _e( 'Blog Archive', 'graphene' ); ?>
<?php endif; ?>
</h1>
<div class="products-box type-slab">
<div class="products-list">
<?php while ( have_posts() ) : the_post(); ?>
<?php include RCL_PATH.'https://karate-wkf.ru/wp-content/plugins/wp-recall/add-on/commerce/templates/product-slab.php'; ?>
<?php endwhile; ?>
</div>
</div>
<?php graphene_posts_nav(); ?>
<?php get_footer(); ?>
Preci сказал(а)
Во-первых шаблоны должны быть не в корне сайта, а в папке темы
Во-вторых так нельзя делать:<?php include RCL_PATH.'https://karate-wkf.ru/wp-content/plugins/wp-recall/add-on/commerce/templates/product-slab.php'; ?>
Переместила 3 файла в тему сайта. А код как писать?
<?php include RCL_PATH.'/wp-content/plugins/wp-recall/add-on/commerce/templates/product-slab.php'; ?>