Skip to content

Instantly share code, notes, and snippets.

View flayder's full-sized avatar
🏠
Working from home

Artem flayder

🏠
Working from home
View GitHub Profile
<?
$arResult['SECTION_ID'] = CIBlockFindTools::GetSectionID( $arResult['VARIABLES']['SECTION_ID'], $arResult['VARIABLES']['SECTION_CODE'], array('IBLOCK_ID' => $arParams['IBLOCK_ID']) );
echo $arResult['SECTION_ID'];
?>
<?=CUtil::GetAdditionalFileURL(SITE_TEMPLATE_PATH.название файла ?>
<script type="text/javascript" >
$(document).ready(function() {
$('.minus').click(function () {
var $input = $(this).parent().find('input');
var count = parseInt($input.val()) - 1;
count = count < 1 ? 1 : count;
$input.val(count);
$input.change();
return false;
});
В section.php добавляем:
<?if ($_GET["sort"] == "name" ||
$_GET["sort"] == "catalog_PRICE_3" ||
$_GET["sort"] == "property_PRODUCT_TYPE" ||
$_GET["sort"] == "timestamp_x"){
$arParams["ELEMENT_SORT_FIELD"] = $_GET["sort"];
$arParams["ELEMENT_SORT_ORDER"] = $_GET["method"];
}else{}?>
В template.php:
<p>Сортировать по:
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
<?php
global $product;
$attachment_ids = $product->get_gallery_attachment_ids();
foreach( $attachment_ids as $attachment_id )
{
//Get URL of Gallery Images - default wordpress image sizes
echo $Original_image_url = wp_get_attachment_url( $attachment_id );
echo $full_url = wp_get_attachment_image_src( $attachment_id, 'full' )[0];
echo $medium_url = wp_get_attachment_image_src( $attachment_id, 'medium' )[0];
/*
* функция добавления редактора
*/
function true_double_editor() {
global $post;
echo '<h2>Галерея</h2>'; // заголовок ко второму редактору
wp_editor( get_post_meta($post->ID, '_true_editor_data', true), 'trueeditor' );
}
add_action( 'edit_form_advanced', 'true_double_editor' );
//хук в init action и вызов create_book_taxonomies когда хук сработает
add_action( 'init', 'create_topics_hierarchical_taxonomy', 0 );
//задаем название для произвольной таксономии Topics для ваших записей
function create_topics_hierarchical_taxonomy() {
// Добавляем новую таксономию, делаем ее иерархической вроде рубрик
// также задаем перевод для интерфейса
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="row">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand visible-xs" href="http://1zaicev.ru/">Бизнес в Сети</a>
function register_post_type() {
$args = array( 'public' => true, 'label' => 'Job Listing' );
register_post_type( 'job', $args );
}
add_action( 'init', 'register_post_type' );