Skip to content

Instantly share code, notes, and snippets.

View jimboobrien's full-sized avatar

Jimobrien jimboobrien

View GitHub Profile
/*****************************************************************************/
/**************VISIONQUEST CUSTOM FUNCTIONS***********************/
Use get_template_directory_uri() when working with theme
Use get_stylesheet_uri () when wrking with child theme
/******************************************************************************/
/**
* Proper way to enqueue scripts and styles in header as of Mar 2016
*/
function my_theme_scripts() {
/*========================================
CSS Resets
=========================================*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
/* CHANGE URL IN DB */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~USE THIS ONE IN PHPMYADMIN ~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
UPDATE wp_posts set post_content=REPLACE(post_content, 'www.devServer.com/', 'www.liveServer.com/');
/* CUSTOM FIELDS INCLUDED */
UPDATE wp_postmeta SET meta_value= replace(meta_value, 'http://old-domain.com', 'http://new-domain.com');
/*~~~~~~~~~~~~~
RESTART SERVICES
~~~~~~~~~~~~~~~*/
restart apache:
service named restart
OR
/scripts/restartsrv_apache
<?php
/*
Template Name: Home Template
*/
?>
<?php get_header(); ?>
<section id="octane-video">
/*****************************************************************************/
/**************VISIONQUEST WOOCOMMERCE CUSTOM FUNCTIONS***********************/
/******************************************************************************/
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
/* fix pesky slider */
.et_pb_slides .et_pb_slide { min-height: 500px; }
@media only screen and (max-width: 980px) {
.et_pb_slides .et_pb_slide { min-height: 300px; }
}
<?phpphp
/*
Template Name: Sitemap Template
*/
?>
<?php get_header(); ?>
<div class="container">
<!-- Example row of columns -->
@jimboobrien
jimboobrien / charge.php
Last active March 12, 2017 21:09
This is a few code snippets that will make a custom form with variable amounts for the Stripe API. It sends a token safely to charge.php and then sends the data to both Stripe via API, but also sends the user an email address letting them know a transaction has been processed. The Customer data in Stripe can only be found in the Description. You…
<?php
try {
require_once('Stripe/lib/Stripe.php');
Stripe::setApiKey("sk_live_XXXXXXXXXXXXXXXXXXXXXXXX");
$token = $_POST['stripeToken'];
$form_amount = $_POST['payamount'];
$strName = $_POST["txtFormName"];
<script src="https://checkout.stripe.com/checkout.js"></script>
<button id="customButton">Purchase</button>
<script>
var handler = StripeCheckout.configure({
key: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX',
image: '/img/documentation/checkout/marketplace.png',
locale: 'auto',
token: function(token) {