Skip to content

Instantly share code, notes, and snippets.

View emaklakov's full-sized avatar
👨‍💻
Developing...

Maklakov Evgeniy emaklakov

👨‍💻
Developing...
View GitHub Profile
@emaklakov
emaklakov / functions.php
Created April 27, 2018 03:25
WordPress | Start Functions File
<?php
define("THEME_DIR", get_template_directory_uri());
add_filter('show_admin_bar', '__return_false'); // отключить
//add_filter('show_admin_bar', '__return_true'); // включить
// Очистка WP
remove_action('wp_head', 'wp_generator');
remove_action('wp_head','feed_links_extra', 3); // убирает ссылки на rss категорий
remove_action('wp_head','feed_links', 2); // минус ссылки на основной rss и комментарии
@emaklakov
emaklakov / How to Get Category Slug
Last active April 25, 2018 11:21 — forked from kisildev/index.php
WordPress | How to Get Category Slug
<?php
if(is_category()) {
$category = get_query_var('cat');
$current_cat = get_category($cat);
echo 'The slug is ' . $current_cat->slug;
}
?>
@emaklakov
emaklakov / post-thumbnail.html
Last active April 25, 2018 11:20 — forked from agragregra/post-thumbnail.html
WordPress | Post Thumbnail URL
<?php $url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' ); $url = $url['0']; ?>
@emaklakov
emaklakov / counter.js
Last active April 25, 2018 11:20 — forked from agragregra/counter.js
JS | Counter from Time
function renderCleanCounter()
{
var curDate = new Date();
var counterBlock = $('#counter');
var counterResulte = Math.round((curDate.getTime() - 1429460070577) / 3000) + 23124;
counterBlock.html(counterResulte);
}
@emaklakov
emaklakov / term_name.php
Last active April 25, 2018 11:22 — forked from agragregra/term_name.php
WordPress | WP_Query by term name
$term = $wp_query->queried_object;
$args = array(
'post_type' => 'specialists',
'posts_per_page' => -1,
'category_name' => $term->name
);
$query = new WP_Query( $args );
@emaklakov
emaklakov / fonts.js
Last active April 25, 2018 11:22 — forked from agragregra/fonts.js
WebFonts | LocalStorage HTML5
<script id="webfont-localstorage-js">!function(){function e(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)}function t(e){return window.localStorage&&localStorage.font_css_cache&&localStorage.font_css_cache_file===e}function n(){if(window.localStorage&&window.XMLHttpRequest)if(t(o))a(localStorage.font_css_cache);else{var n=new XMLHttpRequest;n.open("GET",o,!0),e(n,"load",function(){4===n.readyState&&(a(n.responseText),localStorage.font_css_cache=n.responseText,localStorage.font_css_cache_file=o)}),n.send()}else{var c=document.createElement("link");c.href=o,c.rel="stylesheet",c.type="text/css",document.getElementsByTagName("head")[0].appendChild(c),document.cookie="font_css_cache"}}function a(e){var t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}var o="css/fonts.css";window.localStorage&&localStorage.font_css_cache||document.cookie.indexOf("font_css_cache")>-1?n():e(window,"load",n)}();</script>
@emaklakov
emaklakov / jsnewtab.js
Last active April 25, 2018 11:22 — forked from agragregra/jsnewtab.js
JS | Open In New Tab
window.open("http://", "_blank");
@emaklakov
emaklakov / mousewheel-icon.html
Last active April 25, 2018 11:23 — forked from agragregra/mousewheel-icon.html
Mouse | Wheel Animation CSS Icon | http://jsfiddle.net/cmajo9h6/
<style>
/* ---------------------------------------------- /*
* Mouse animate icon
/* ---------------------------------------------- */
.mouse-icon {
border: 2px solid #000;
border-radius: 16px;
height: 40px;
width: 24px;
display: block;
@emaklakov
emaklakov / chrome-smooth-scroll.js
Last active April 25, 2018 11:23 — forked from agragregra/chrome-smooth-scroll.js
Chrome | Smooth Scroll
//Chrome Smooth Scroll
try {
$.browserSelector();
if($("html").hasClass("chrome")) {
$.smoothScroll();
}
} catch(err) {
};
@emaklakov
emaklakov / jquery-active.js
Last active April 25, 2018 11:23 — forked from agragregra/jquery-active.js
jQuery | Active Menu
//Active menu
$("li a").each(function() {
if (this.href == window.location.href) {
$(this).addClass("active");
}
});