Skip to content

Instantly share code, notes, and snippets.

View theory-of-soul's full-sized avatar

Tatiana theory-of-soul

View GitHub Profile
<script type="text/javascript">var mdate = new Date(); document.write(mdate.getFullYear());</script>
@theory-of-soul
theory-of-soul / gist:f421878aada098d641b3
Created September 7, 2015 10:06
удалить стандартный jquery в wordpress
<?php wp_deregister_script('jquery'); ?>
//добавить перед <?php wp_head(); ?>
npm install rimraf -g
rimraf node_modules
<script>
var ourMailTop = document.getElementById("ymOurMail");
function copyMail(name) {
if(name) {
name.addEventListener('copy', function() {
yaCounter32108701.reachGoal('copyMail');
});
}
}
window.onload = function () {
yaCounter32108701.reachGoal('page404');
}
В файл настройки плагина, дополнительные настройки для главной страницы:
if ((is_front_page()==true)) {
$meta_string = sprintf("<meta name=\"description\" content=\"%s\"/>", 'Компания АО «БиГ» занимается производством и реализацией металлоконструкций, железобетонных конструкций и опор ЛЭП. Более 10-ти лет наша Компания на рынке электроэнергетики России и стран СНГ.');
$meta_string .= "\n";
$meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\"/>\n", 'Производство металлоконструкций, Производство железобетонных конструкций, Производство опор ЛЭП, Плазменная резка, Обработка металла');
}
else{
if (isset ($description) && !empty($description)) {
$meta_string = sprintf("<meta name=\"description\" content=\"%s\"/>", $description);
@theory-of-soul
theory-of-soul / breadcrumbs WP
Created December 25, 2015 06:34
breadcrumbs WP
function dimox_breadcrumbs() {
/* === OPTIONS === */
$text['home'] = 'Главная'; // текст ссылки "Главная"
$text['category'] = 'Архив рубрики "%s"'; // текст для страницы рубрики
$text['search'] = 'Результаты поиска по запросу "%s"'; // текст для страницы с результатами поиска
$text['tag'] = 'Записи с тегом "%s"'; // текст для страницы тега
@theory-of-soul
theory-of-soul / gist:aef98bae731562d107ce
Created December 29, 2015 09:47
замена подстроки в строке SQL
UPDATE таблица SET поле = REPLACE(поле, 'что_меняем', 'на_что_меняем')
<? global $wpcf7_contact_form;
if ( ! ( $wpcf7_contact_form = wpcf7_contact_form( 34 ) ) )
return 'Contact form not found!';
$form = $wpcf7_contact_form->form_html();
echo $form; ?>
<?if (!empty($arResult["PROPERTIES"]["ANOTHER_LINKS"]["VALUE"])):?>
<?foreach($arResult["PROPERTIES"]["ANOTHER_LINKS"]["VALUE"] as $photo):
$arFileTmp = CFile::ResizeImageGet(
$photo,
array(
"width" => 280,
"height" => 180),
BX_RESIZE_IMAGE_EXACT,
false,
array()