Skip to content

Instantly share code, notes, and snippets.


Tania Rascia taniarascia

Block or report user

Report or block taniarascia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
taniarascia / .htaccess
Last active Jan 5, 2016
Fix .svg broken links in server
View .htaccess
AddType image/svg+xml svg
AddType image/svg+xml svgz
taniarascia / .htaccess
Created Jul 9, 2015
Remove .php from filename
View .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
taniarascia / toggle.js
Last active Aug 29, 2015
Toggle navigation with jQuery
View toggle.js
function toggleNav() {
if ($('#wrapper').hasClass('show-nav')) {
// Do things on Nav Close
} else {
// Do things on Nav Open
taniarascia / sticky.js
Last active Aug 29, 2015
Navigation bar under header stick to top on scroll with jQuery
View sticky.js
$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
} else {
taniarascia / wp-main.php
Last active Aug 29, 2015
Common Wordpress queries
View wp-main.php
the_ and get_the are two different queries. For example, the_title(); will echo out the title field into your HTML document, and get_the_title(); can be inserted into a value.
<?php the_title(); ?> // Title
<?php the_content(); ?> // Full entry
<?php the_excerpt(); ?> // Partial entry
<?php the_permalink(); ?> // Calls a specific link
<?php the_category(); ?> // Calls the category
taniarascia / random-image.php
Last active Aug 29, 2015
Call random image
View random-image.php
$random = rand(0, 2);
$picture = array(
<img src="<?php echo $picture[$random];?>"></a>
taniarascia / echo-page-content.php
Last active Aug 29, 2015
Post the contents of one page on another page
View echo-page-content.php
$include = get_pages('include=6'); // Insert page number here
$content = apply_filters('the_content',$include[0]->post_content);
echo $content;
taniarascia / click-function.js
Created Jul 16, 2015
Call a function with a click event with jQuery
View click-function.js
$(function() {
$('.classname').click(function() {
// Calling a function in case you want to expand upon this.
taniarascia / overlay-color-div.css
Created Jul 25, 2015
Overlay a color and opacity to a background image
View overlay-color-div.css
.box {
.fade {
position: relative;
.fade:after {
taniarascia / functions.php
Created Jul 27, 2015
Add meta to regular page post
View functions.php
// register your custom meta box
function my_slider_properties_meta_box() {
add_meta_box('my_slider_properties', 'Link Format Title URL', 'my_slider_properties', 'page', 'side', 'default');
add_action('add_meta_boxes', 'my_slider_properties_meta_box');
// echo your custom meta box
function my_slider_properties() {
global $post;
You can’t perform that action at this time.