Skip to content

Instantly share code, notes, and snippets.

View robertdevore's full-sized avatar
🐺
#LoneWolfLifestyle

Robert DeVore robertdevore

🐺
#LoneWolfLifestyle
View GitHub Profile
@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-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 / 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 / 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>
@robertdevore
robertdevore / wpd-display-categories.php
Last active April 30, 2017 13:32
WP Dispensary - display categories at the bottom of the Details table
<?php
/**
* WPD - Display categories in the Data Details table
*/
add_action( 'wpd_dataoutput_bottom', 'add_wpd_categories' );
function add_wpd_categories() { ?>
<?php if ( in_array( get_post_type(), array( 'flowers' ) ) ) { ?>
<tr><td><span>Categories:</span></td><td><?php echo get_the_term_list( $post->ID, 'flowers_category', '', ', ' ); ?></td></tr>
<?php } ?>
<?php if ( in_array( get_post_type(), array( 'concentrates' ) ) ) { ?>
@robertdevore
robertdevore / wp-dispensary-inventory-management-add-actions.php
Created April 30, 2017 14:35
Add your own "In Stock" message to the Dispensary Inventory Management add-on via WP Dispensary
<?php
/** Adds a new version of the In Stock message for each menu type */
add_action( 'wpd_dataoutput_bottom', 'add_wpd_inventory_data', 10 );
function add_wpd_inventory_data() { ?>
<?php if ( ! get_post_meta( get_the_ID(), '_inventory_flowers', true ) ) { } else { ?>
<tr><td><span>In stock:</span></td><td>YES</td></tr>
<?php } ?>
<?php if ( ! get_post_meta( get_the_ID(), '_inventory_concentrates', true ) ) { } else { ?>
<tr><td><span>In stock:</span></td><td>YES</td></tr>
<?php } ?>