Skip to content

Instantly share code, notes, and snippets.

View robertdevore's full-sized avatar
🛠️
#NeverNotWorking

Robert DeVore robertdevore

🛠️
#NeverNotWorking
View GitHub Profile
@robertdevore
robertdevore / raspberry-pi-comcast-speed-bot.py
Created February 1, 2016 17:25
Python script for Raspberry Pi Comcast Speed Bot
# source https://www.reddit.com/r/technology/comments/43fi39/i_set_up_my_raspberry_pi_to_automatically_tweet/
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
@robertdevore
robertdevore / wpd-edibles-total-thc-mg.php
Last active May 12, 2017 23:00
Display WP Dispensary Edibles total THC mg per unit
<?
/**
* By default, WP Dispensary has options for dispensary owners
* to add in THC mg per serving and serving count to each edible added.
*
* The below code snippet finds the THC mg and Servings numbers, multiplies
* them together and then spits out the total THC mg per unit
*/
add_action( 'wpd_dataoutput_bottom', 'thc_mg_per_package', 10 );
function thc_mg_per_package() {
@robertdevore
robertdevore / functions.php
Last active September 21, 2016 23:00
Adding Bootstrap files to Underscores theme
<?php
/**
* Enqueue scripts and styles.
*/
function bliss_theme_scripts() {
wp_enqueue_style( 'bliss-theme-style', get_stylesheet_uri() );
wp_enqueue_style( 'bliss-theme-bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css' );
wp_enqueue_script( 'bliss-theme-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20160921', true );

Keybase proof

I hereby claim:

  • I am deviodigital on github.
  • I am deviodigital (https://keybase.io/deviodigital) on keybase.
  • I have a public key whose fingerprint is C51A D40B 9A89 E85C AA79 5604 C5D7 F97A 5C33 1878

To claim this, I am signing this object:

<?php
/**
* Display the quote meta data in your theme
*/
if ( get_post_meta( get_the_ID(), '_thequote', true ) ) {
$quote = get_post_meta( $post->ID, '_thequote', true );
echo $quote;
}
/**
* Display the author meta data in your theme
@robertdevore
robertdevore / add-products-to-woocommerce.php
Created October 5, 2016 15:21
Adding products to WooCommerce with PHP
<?php
/**
* http://wordpress.stackexchange.com/a/137578
*/
$post = array(
'post_author' => $user_id,
'post_content' => '',
'post_status' => "publish",
'post_title' => $product->part_num,
'post_parent' => '',
@robertdevore
robertdevore / wpd-action-hook-details-table.php
Last active October 11, 2016 18:45
WP Dispensary Action Hook for Details Table
<?php
add_action( 'wpd_dataoutput_bottom', 'your_function_name' );
function your_function_name() {
echo 'example';
}
?>
@robertdevore
robertdevore / wpd-action-hook-pricing-table.php
Created October 11, 2016 18:45
WP Dispensary Action Hook for Pricing Table
<?php
add_action( 'wpd_pricingoutput_bottom', 'your_function_name' );
function your_function_name() {
echo 'example';
}
?>
@robertdevore
robertdevore / loop-forums.php
Last active November 16, 2016 21:27
Customizing the forum display for bbPress to be more like standard forums
<?php
/**
* Forums Loop
*
* @package bbPress
* @subpackage Theme
*
* Original code via: https://bbpress.org/forums/topic/forums-index-in-the-same-layout-as-other-bb-software/
*/
?>
@robertdevore
robertdevore / wordpress-login-html-form.php
Created November 16, 2016 23:41
WordPress login form
<?php
$redirect_to = '';
?>
<form name="loginform" id="loginform" action="<?php echo site_url( '/wp-login.php' ); ?>" method="post">
<p>Username: <input id="user_login" type="text" size="20" value="" name="log"></p>
<p>Password: <input id="user_pass" type="password" size="20" value="" name="pwd"></p>
<p><input id="rememberme" type="checkbox" value="forever" name="rememberme"></p>
<p><input id="wp-submit" type="submit" value="Login" name="wp-submit"></p>