Skip to content

Instantly share code, notes, and snippets.

View taniarascia's full-sized avatar
💾

Tania Rascia taniarascia

💾
View GitHub Profile
@taniarascia
taniarascia / modal.php
Last active February 13, 2024 07:53
Create modal popup
$(function(){
$("#modal-launcher, #modal-background, #modal-close").click(function () {
$("#modal-content,#modal-background").toggleClass("active");
});
});
#modal-background {
display: none;
position: fixed;
top: 0;
@taniarascia
taniarascia / custom-admin-area.php
Created July 29, 2015 18:26
function.php add custom admin are
// Create custom admin area
add_action('admin_menu', 'add_leye_interface');
function add_leye_interface() {
add_options_page('LEYE Custom Fields', 'LEYE Custom Fields', '8', 'functions', 'editleyecustomfields');
}
function editleyecustomfields() {
?>
<div class='wrap'>
@taniarascia
taniarascia / dropdown.js
Created August 5, 2015 21:20
Enable Dropdown Navigation
;
(function ($) {
// DOM ready
$(function () {
// Toggle open and close nav styles on click
$('#nav-toggle').click(function () {
@taniarascia
taniarascia / no-qp.php
Created August 26, 2015 20:58
Pull without query_posts
$args = array(
'post_type' => 'post-custom',
'order' => 'ASC',
'posts_per_page' => -1,
'fields' => 'ids'
);
$post_ids = get_posts( $args );
foreach ( $post_ids as $id ) {
$meta = get_post_meta( $id, '_my_meta', true );
@taniarascia
taniarascia / featured.php
Created September 1, 2015 22:09
Featured Image
@taniarascia
taniarascia / custom-post.php
Created September 1, 2015 22:09
Correct Way to Pull From a Custom Loop
<?php get_header(); ?>
<?php $featured_image = wp_get_attachment_url(get_post_thumbnail_id($page->ID));
if (have_posts()) : while (have_posts()) : the_post();
?>
<div class="container" id="services_container">
<img src="<?php echo $featured_image;?>" class="left_image">
<div class="left_box">
<h2><?php the_title();?></h2>
<p>
<?php the_content();?>
@taniarascia
taniarascia / .htaccess
Last active February 13, 2024 07:53
Page Speed Optimization
## Expires
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
@taniarascia
taniarascia / fade.js
Created September 16, 2015 19:03
Fade Items Into View on Scroll
$(window).scroll(function () {
/* Check the location of each desired element */
$('.fade').each(function (i) {
var bottom_of_object = $(this).offset().top + $(this).outerHeight();
var bottom_of_window = $(window).scrollTop() + $(window).height();
/* If the object is completely visible in the window, fade it in */
if (bottom_of_window > bottom_of_object) {
@taniarascia
taniarascia / hover.js
Created September 16, 2015 19:20
Show after hover for period of time
var fadeTimeout;
console.log(fadeTimeout);
$("#menu").hover(function () {
fadeTimeout = setTimeout(showFade, 2000);
},
hideFade);
function showFade() {
var fade = $("<div class='secret-menu'><a href='secret-menu.pdf' style='color:black' >Shhhh! Secret Menu!</a></div>");
fade.appendTo($("#menu"));
@taniarascia
taniarascia / redirect.php
Created September 16, 2015 20:02
PHP Redirect
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.New-Website.com");
?>