Skip to content

Instantly share code, notes, and snippets.

View iledcom's full-sized avatar

Konstantyn iledcom

View GitHub Profile
@iledcom
iledcom / Output of an custom field
Created March 9, 2017 14:27
WP/Output of an custom field
// Необходимо вывести поле содержащее текст "Подробнее"
//Произвольные поля
//Имя: more
//Значение: Подробнее
$more = get_post_custom_values('more');
<?php echo $more[0];?>
@iledcom
iledcom / add_settings_section
Last active March 7, 2017 16:04
Add a block of options to the basic page "General" WP
// ------------------------------------------------------------------
// Вешаем все блоки, поля и опции на хук admin_init
// ------------------------------------------------------------------
//
add_action( 'admin_init', 'site_name_api_init' );
function site_name_api_init() {
// Добавляем блок опций на базовую страницу "Общие"
add_settings_section(
'site_name_section', // секция
'Настройки шапки сайта',
@iledcom
iledcom / Fixed menu jQuery
Last active February 15, 2017 10:17
Fixed menu (a selector) when the page scrolls
//common.js
$(function() {
$(window).scroll(function() {
var the_top = $(document).scrollTop();
if (the_top > 1) {
$('.site-navigation-wrap').addClass('fixed-menu');
}
else {
$('.site-navigation-wrap').removeClass('fixed-menu');
}
@iledcom
iledcom / expand abbreviation by tab
Created December 19, 2016 15:28
Emmet for sublimetext 3 ul>li
{ "keys": ["tab"], "command": "expand_abbreviation_by_tab", "context":
[
{
"operand": "source.css, source.sass, source.less, source.scss, source.stylus, source.postcss, source.jade, text.jade, text.slim, text.xml, text.html - source, text.haml, text.scala.html, source string",
"operator": "equal",
"match_all": true,
"key": "selector"
},
{
"operand": "storage.type.templatetag.django",
@iledcom
iledcom / Категории третьего уровня в OpenCart2
Last active June 16, 2017 07:46
Категории третьего уровня в OpenCart2
Меняем в файле /home/ohranactr/public_html/catalog/controller/common/header.php
это:
foreach ($children as $child) {
$filter_data = array(
'filter_category_id' => $child['category_id'],
'filter_sub_category' => true
);
$children_data[] = array(
@iledcom
iledcom / Drupal 7 URL taxonomy term
Created November 19, 2015 16:03
Drupal 7 URL taxonomy term
$url = drupal_lookup_path('alias', 'taxonomy/term/'.$known_tid, $lang_code);
@iledcom
iledcom / The third level of the categories in the main menu opencart 1.5
Last active August 26, 2016 07:41
OpenCart. The third level of the categories in the main menu
//3 level
//*** Получаем список подкгатегорий для каждой категории второго уровня
$subchildren = $this->model_catalog_category->getCategories($child['category_id']);
//*** Обнуляем массив для каждого набора подкатегорий вторго уровня
$subchildren_data = array();
//*** Получаем список подкгатегорий для каждой категории второго уровня
foreach ($subchildren as $subchild) {
@iledcom
iledcom / PHP message handler: sendmail.php
Created September 22, 2015 15:21
PHP message handler: sendmail.php
file: sendmail.php
<?php
session_start();
if (isset($_POST["send"])) {
$from = $_POST["from"];
$to = $_POST["to"];
$subject = $_POST["subject"];
$message = $_POST["message"];
$_SESSION["from"] = $from;
$_SESSION["to"] = $to;
@iledcom
iledcom / WordPress get_bloginfo('description')
Created September 16, 2015 09:22
WordPress get_bloginfo('description')
<?php echo get_bloginfo('description');?>
@iledcom
iledcom / WordPress get_bloginfo('name')
Created September 16, 2015 09:22
WordPress get_bloginfo('name')
<?php echo get_bloginfo('name');?>