Skip to content

Instantly share code, notes, and snippets.

View taniarascia's full-sized avatar
💾

Tania Rascia taniarascia

💾
View GitHub Profile
@taniarascia
taniarascia / sticky.js
Last active August 29, 2015 14:24
Navigation bar under header stick to top on scroll with jQuery
$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
$('div').addClass('stickyheader');
} else {
$('div').removeClass('stickyheader');
}
});
@taniarascia
taniarascia / overlay-color-div.css
Created July 25, 2015 04:39
Overlay a color and opacity to a background image
.box {
width:350px;
height:150px;
}
.fade {
position: relative;
}
.fade:after {
@taniarascia
taniarascia / thumbnail-function.php
Last active August 29, 2015 14:26
Force uploaded media to create a certain thumbnail size
// Add 250 x 250 thumbnail to every image uploaded
add_image_size( 'gallery-thumbnail', 250, 250, true );
// gallery_thumbnail is a custom size! It can have any name.
// Call it later in a gallery loop.
<section id="gallery_page">
<ul class="gal columns-4">
<?php
$args = array(
@taniarascia
taniarascia / page-loop.php
Created July 29, 2015 16:18
Display a particular page's loop
<?php $my_query = new WP_Query('page_id=87');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;?>
<div class="entry">
<?php the_content('read more &raquo;'); ?>
</div>
@taniarascia
taniarascia / post-id.php
Created August 5, 2015 22:08
When all else fails with custom content
if($post->ID == '4331') {} else {}
@taniarascia
taniarascia / redirect.php
Last active September 4, 2015 20:26
Permanent PHP Redirect
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.new.com");
?>
@taniarascia
taniarascia / facebook.html
Created September 10, 2015 18:15
Meta Facebook post information
<meta property="og:image" content="img.jpg" />
<meta property="og:title" content="Title" />
<meta property="og:description" content="Desc." />
@taniarascia
taniarascia / focus.js
Created September 10, 2015 22:00
Do action onclick AND focus - AKA when pressing tab.
$("#fullname").bind('click keypress keyup change focus', function(){
$("#note_email").fadeIn();
});
$("#fullname").bind('focus', function(){
$("#note_email").fadeIn();
});
OR
<link rel="icon" type="image/png" href="images/favicon.png">
@taniarascia
taniarascia / date.php
Created November 2, 2015 19:50
Pulling date via $_GET from URL, parsing it into strings to be used later
<?php
// No date is set if they didn't click a specific date
$eventDate = false;
// If 'date' is in the URL
if(isset($_GET[date])) {
// Date is set
$eventDate = true;