Skip to content

Instantly share code, notes, and snippets.

add_action('wp-routes/register_routes', function(){
with('/location-api', function(){
respond('GET', '/[i:id]', function($request){
$post = get_post($request->id);
// $post = get_posts(array('post_type' => 'location'));
header('Content-Type: application/json');
if ($post) {
$fields = array(
'post_id' => $post_id = $post->ID,
'title' => $post->post_title,
function site_header() { ?>
<div class="page-wrap">
<div class="site-header">
<div class="container">
<div id="navtoggle">
<a href="#"><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></a>
</div>
<div id="tel">
<a href="tel:+12056036118">205.603.6118</a>
</div>
//on line #159 change:
// hook to add additional stylesheets from a child theme
echo apply_filters ('child_add_stylesheets',$stylesheets);
//to:
// hook to add additional stylesheets from a child theme
apply_filters ('child_add_stylesheets',$stylesheets);
// Enqueue the Slick slider CSS
function child_css() {
wp_enqueue_style('slick', get_stylesheet_directory_uri().'/slick/slick.css', array('style'), '1.0', 'screen, projection');
wp_enqueue_style('slick-theme', get_stylesheet_directory_uri().'/slick/slick-theme.css', array('style'), '1.0', 'screen, projection');
}
add_filter( 'add_stylesheets','child_css' );
// Enqueue the Slick slider Javascripts
function child_scripts() {
wp_enqueue_script('slick', get_stylesheet_directory_uri()."/slick/slick.min.js",array('jquery'),'1.0',false);
function skeleton_header_open() {
echo '<div id="header">';
echo '<div class="topbar">';
// phone number
echo '<span class="tel">1.800.555.1212</span>';
// search form
get_search_form(true);
echo '<ul class="header_social_icons">';
// Add your social icons below
echo '<li><a href="http://twitter.com"><i class="fa fa-twitter"></i></a></li>';
function st_transport_theme_mods() {
global $wpdb;
$themetitle = 'synapse';
$themedata = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", $themetitle));
if ($themedata) {
$wpdb->update(
$wpdb->options, // table
array( 'option_value' => $themedata ), // column => data
array( 'option_name' => $themetitle.'child' ) // where column
function element_transport_theme_mods() {
global $wpdb;
$themedata = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", 'element'));
if ($themedata) {
$wpdb->update(
$wpdb->options, // table
array( 'option_value' => $themedata ), // column => data
array( 'option_name' => 'elementchild' ) // where column
);
<?php
/**
* Lightfast Child Theme
*
*/
function st_remove_wrapper() {
// removes the opening div#wrap
remove_action('skeleton_header','skeleton_mainwrap_open');
@simplethemes
simplethemes / functions.php
Created August 12, 2014 18:51
WooCommerce Mobius
/*-----------------------------------------------------------------------------------*/
// WooCommerce Compatibility
/*-----------------------------------------------------------------------------------*/
// Add Theme Support for WC
add_theme_support( 'woocommerce' );
// Wrap WC in native theme functions
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
<?php
$start = "11:00 am";
$end = "12:30 pm";
$current_time = date('h:i a');
$date1 = DateTime::createFromFormat('h:i a', $current_time);
$date2 = DateTime::createFromFormat('h:i a', $start);
$date3 = DateTime::createFromFormat('h:i a', $end);