Skip to content

Instantly share code, notes, and snippets.

View taniarascia's full-sized avatar
💾

Tania Rascia taniarascia

💾
View GitHub Profile
@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 / 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 / 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 / simple-grid.less
Created December 10, 2015 16:16
Repeating Grid
.grid {
list-style: none;
padding: 0;
margin: 0;
&:after {
display: table;
content: '';
clear: both;
}
}
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 / 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");
})
});
<?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 / 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
};
Functions.php:
function get_custom(){
return 'http://www.custom.com';
}
<?php echo get_custom();?>
@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;