Skip to content

Instantly share code, notes, and snippets.

View taniarascia's full-sized avatar
💾

Tania Rascia taniarascia

💾
View GitHub Profile
@taniarascia
taniarascia / maps.js
Last active February 13, 2024 07:52
Google Maps APIs for Multiple Locations
function initMap() {
var broadway = {
info: '<strong>Chipotle on Broadway</strong><br>\
5224 N Broadway St<br> Chicago, IL 60640<br>\
<a href="https://goo.gl/maps/jKNEDz4SyyH2">Get Directions</a>',
lat: 41.976816,
long: -87.659916
};
<?php $URL = explode('.', $_SERVER[HTTP_HOST]);
if($URL[0] == 'dev') {
define('DB_NAME', 'dbname_dev');
define('DB_USER', 'dbuser');
define('DB_PASSWORD', 'dbpass');
define('DB_HOST', 'dbhost');
} else {
define('DB_NAME', 'dbname');
define('DB_USER', 'dbuser');
@taniarascia
taniarascia / active.js
Created December 2, 2015 20:07
Add active class to active page
$(function () {
var pgurl = window.location.href.substr(window.location.href
.lastIndexOf("/") + 1);
$("nav ul li a").each(function () {
if ($(this).attr("href") == pgurl || $(this).attr("href") == '')
$(this).addClass("active");
})
});
Hi Client,
Because I haven't heard back from you since August 4th, I am assuming that your priorities have changed and at this point I am not sure whether or not you wish to continue with the project. If you do need to cancel, I would like to discuss reworking our project milestones so that I can receive a partial payment for the work that I did complete and the remaining fees can be returned to you from Escrow.
If you do wish to continue with the project, please advise what your new timeline is so that I can schedule other projects accordingly and ensure that I can complete your project as a priority. You can reach me through the Elance workroom, via email at xxxx@gmail.com, or by phone at xxx.xxx.xxxx.
I hope to continue working with you on the project to full completion per our original discussion and look forward to hearing back from you soon. Thanks in advance!
Best, me
@taniarascia
taniarascia / functions.php
Created December 10, 2015 18:34
Global PHP Variables for WordPress!
<?php
//Custom Theme Settings
add_action('admin_menu', 'add_gcf_interface');
function add_gcf_interface() {
add_options_page('Global Custom Fields', 'Global Custom Fields', '8', 'functions', 'editglobalcustomfields');
}
function editglobalcustomfields() {
@taniarascia
taniarascia / first-post.php
Created December 10, 2015 19:10
Apply code to only first post
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; $c=0;?>
<?php while (have_posts()) : the_post(); ?>
<?php $c++;
if( $c == 1) :?>
<h1>The first post on the main index page</h1>
<?php the_title(); ?>
<?php the_excerpt(); ?>
@taniarascia
taniarascia / script-functions.php
Last active February 13, 2024 07:51
Add styles and scripts
// Add Stylesheets
function oblate_scripts() {
wp_enqueue_style( 'style', get_template_directory_uri() . '/css/style.min.css' );
wp_enqueue_script( 'prism', get_template_directory_uri() . '/js/prism.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'oblate_scripts' );
@taniarascia
taniarascia / google-fonts.php
Created December 14, 2015 04:25
Google Fonts
// Google Fonts
function load_fonts() {
wp_register_style('OpenSans', 'http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800');
wp_register_style('NotoSerif', 'http://fonts.googleapis.com/css?family=Noto+Serif:400,700');
wp_register_style('RobotoMono', 'http://fonts.googleapis.com/css?family=Roboto+Mono:400,300,500,700');
wp_enqueue_style( 'OpenSans');
wp_enqueue_style( 'NotoSerif');
wp_enqueue_style( 'RobotoMono');
}
@taniarascia
taniarascia / emoji.php
Created December 14, 2015 04:26
Disable Emojis
function disable_wp_emojicons() {
// all actions related to emojis
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
@taniarascia
taniarascia / thumb.php
Created December 14, 2015 05:49
Echo Thumbnail of Featured Image
<?php if(get_post_thumbnail_id()) {?><div class="flex-responsive"><div class="box _25 pad">
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
$url = $thumb['0']; ?>