Skip to content

Instantly share code, notes, and snippets.

@agragregra
agragregra / parallax-translate3d.js
Last active September 20, 2022 19:23
Smooth Parallax Scroll
$(window).scroll(function() {
var st = $(this).scrollTop() /10;
$(".object").css({
"transform" : "translate3d(0px, " + st + "%, .01px)",
"-webkit-transform" : "translate3d(0px, " + st + "%, .01px)"
});
});
@agragregra
agragregra / post-thumbnail.html
Last active January 8, 2019 13:09
WordPress Post Thumbnail URL
<?php $url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' ); $url = $url['0']; ?>
@agragregra
agragregra / functions.php
Created April 17, 2015 19:21
WordPress functions.php Must Have
show_admin_bar(false);
add_theme_support('post-thumbnails');
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
@agragregra
agragregra / gist:1977780b19b159ff5a98
Last active October 24, 2015 21:01
jQuery Plugin Start
We couldn’t find that file to show.
@agragregra
agragregra / counter.js
Created April 19, 2015 16:51
javaScript Counter from Time
function renderCleanCounter()
{
var curDate = new Date();
var counterBlock = $('#counter');
var counterResulte = Math.round((curDate.getTime() - 1429460070577) / 3000) + 23124;
counterBlock.html(counterResulte);
}
@agragregra
agragregra / term_name.php
Last active December 24, 2020 11:14
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 );
@agragregra
agragregra / fonts.js
Created April 26, 2015 23:42
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>
@agragregra
agragregra / archive.php
Created April 28, 2015 11:36
WordPress Get Full Content
<?php global $more; $more = 1; the_content(); ?>
@agragregra
agragregra / header_fadeout.js
Created May 5, 2015 21:35
jQuery Header Content FadeOut on Scroll
$(window).scroll(function() {
var st = $(this).scrollTop();
if($(window).height()+500 > $("header").height()) {
$("header .col-md-12").css({
"transform" : "translate3d(0px, " + st /18 + "%, 0px)",
"-webkit-transform" : "translate3d(0px, " + st /18 + "%, 0px)",
"opacity" : "1" - st/700
});
@agragregra
agragregra / font64base.css
Created May 8, 2015 14:04
Font 64base CSS
src: url(data:font/woff;charset=utf-8;base64,ДАННЫЕ) format("woff")