query_posts,
он повторно запускает запросы в базу и переопределяет глобальный объект WP_Query
. Из офф. документации:Note: This function will completely override the main query and isn’t intended for use by plugins or themes. Its overly-simplistic approach to modifying the main query can be problematic and should be avoided wherever possible. In most cases, there are better, more performant options for modifying the main query such as via the ‘pre_get_posts’ action within WP_Query.
get_posts или pre_get_posts
- Это обертка WP_Query
, которая упрощает выборку постов и не изменят глобальные переменные, в ней еще определены некоторые дефолтные аргументы из-за чего выборку сделать проще.WP_Query
C:\xampp\php\php.exe C:\xampp\htdocs\magento\bin\magento cron:run
C:\xampp\php\php.exe C:\xampp\htdocs\magento\update\cron.php
C:\xampp\php\php.exe C:\xampp\htdocs\magento\bin\magento setup:cron:run
schtasks /create /sc minute /mo 5 /tn Magento\Cron /путь_к_папке_с_крон_файлом\mycron.bat
php bin/magento cache:disable
и на всякий случай очистить кеш :php bin/magento cache:flush
'cache_types' =>
array (
'config' => 0,
'layout' => 0,
'block_html' => 0,
'collections' => 0,
'reflection' => 0,
'db_ddl' => 0,
'eav' => 0,
'customer_notification' => 0,
'config_integration' => 0,
'config_integration_api' => 0,
'full_page' => 0,
'translate' => 0,
'config_webservice' => 0,
),
<?php
$variable = wp_list_categories('echo=0&show_count=1&title_li=<h3>Рубрики</h3>');
$variable = str_replace(array('(',')'), '', $variable);
echo $variable;
?>
<?php if($product['product_id'] != 2282): // if product_id !=2282 ?>
<button class="btn btn-info" type="button"
<?php if ($this->config->get('mmr_common_addtocart_hide_enabled') && $product['quantity'] < 1) { ?>disabled="disabled" <?php } ?>
onclick="addToCart('<?php echo $product['product_id']; ?>');">
<?php if ($this->config->get('mmr_common_addtocart_hide_enabled') && $product['quantity'] < 1) { ?>
<?php echo $product['stock']; ?>
<?php } else { ?>
<span class="glyphicon icon-cart-btn"></span>
<?php echo $product['manufacturer'] == '216' ? 'Заказать' : $button_cart; ?>
<?php } ?>
</button>
<?php else : // if product_id ==2282 ?>
<a href="<?php echo $product['href']; ?>" class="btn btn-info">В карточку</a>
<?php endif; ?>