Skip to content

Instantly share code, notes, and snippets.

@zaurmag
zaurmag / breadcumbs-wordpress
Last active July 5, 2017 10:36
Хлебные крошки Wordpress
<?php
/*** Функция хлебных крошек ***/
function breadcrumbs_new() {
$mayak_home = 'Главная'; // текст ссылки "Главная"
$mayak_last_crumb = 1; // 1 - показывать название текущей статьи/страницы/рубрики, 0 - не показывать
$mayak_between = ' <span class="crumb_separator">&raquo;</span> ';
$mayak_from = '<span class="current-crumbs">';
$mayak_to = '</span>';
global $post;
$mayak_link_to_home = home_url('/');
@zaurmag
zaurmag / redirect-http-https.txt
Created September 15, 2016 13:07
Редирект с http на https
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://zaurmag.ru/$1 [R=301,L]
@zaurmag
zaurmag / mask-input.js
Last active November 18, 2017 10:01
Маска телефона
// ======= Input Field Mask =======
$(".telMask").inputMask("+7 (999) 999-99-99");
@zaurmag
zaurmag / ie-browser.css
Created August 17, 2016 22:00
Стили для браузера ИЕ
@media screen and (-ms-high-contrast: active),
(-ms-high-contrast: none) {
#page {
display: block;
}
.item-title {
font-size: 24px;
}
}
@zaurmag
zaurmag / view-module-teml-joomla.php
Created August 14, 2016 09:36
Вывод модулей в шаблоне Joomla
<?php //вывод позиции модулей
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$options = array('style' => 'xhtml');
$position = 'user1';
echo $renderer->render($position, $options, null);
?>
<!-- или -->
@zaurmag
zaurmag / is-home.php
Created August 12, 2016 07:28
Условие на главной - Joomla
//Условие - на главной или нет
if (JURI::current() == JURI::base()) {echo "делать то то на главной"};
@zaurmag
zaurmag / responsive-video.css
Created August 7, 2016 18:37
Адаптивное видео Youtube
########################################## Адаптивное видео Youtube
.myvideo {
position:relative;
padding-bottom:56.25%;
padding-top:30px;
height:0;
overflow:hidden;
border:1px solid #ccc;
}
@zaurmag
zaurmag / col-height.js
Created August 7, 2016 18:22
Одинаковая высота колонок
// ======= Одинаковая высота колонок =======
var max_col_height = 0;
$('.list_product .block_product').each(function() {
if ($(this).height() > max_col_height) {
max_col_height = $(this).height();
}
});
$('.list_product .block_product').height(max_col_height);
// Close Alert
@zaurmag
zaurmag / enquireJs.js
Last active August 7, 2016 18:31
Enquire JS
// ======= Enquire JS =======
enquire.register("screen and (max-width:1170px)", {
match: function() {
$('.menu-nav-wrapper').dropdownMenu();
},
unmatch: function() {
$('.menu-nav-wrapper').dropdownMenu({
destroy: true
});
@zaurmag
zaurmag / scroll-spy.js
Last active August 7, 2016 18:27
Выделение пункта меню Skroll Spy
// ======= Scroll Spy Menu =======
var lastId,
topMenu = jQuery("#main-menu"),
topMenuHeight = topMenu.outerHeight(),
menuItems = topMenu.find("a"),
scrollItems = menuItems.map(function() {
var item = jQuery(jQuery(this).attr("href"));
if (item.length) {
return item;