This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function justin_search_join( $join ) { | |
global $wpdb; | |
if( is_search() && !is_admin()) { | |
$join .= "LEFT JOIN $wpdb->postmeta AS m ON ($wpdb->posts.ID = m.post_id) "; | |
} | |
return $join; | |
} | |
// uncomment this to add this functionality | |
//add_filter('posts_join', 'justin_search_join' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add checkbox field to the checkout | |
**/ | |
add_action('woocommerce_after_checkout_billing_form', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
add_filter ('add_to_cart_redirect', 'woo_redirect_to_checkout'); | |
echo '<div id="my-new-field"><h3>'.__('1st Time Student?').'</h3>'; | |
echo '<input id="my_checkbox" type="checkbox" class="input-checkbox" value="1" data-target="http://www.experiumscienceacademy.com/newsite/?add-to-cart=6319"/><label for="my_checkbox" class="checkbox ">Yes!</label>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Redirect directly to checkout page only for ONE product | |
* if cart contains $product_id then go directly to checkout. | |
**/ | |
add_filter ('add_to_cart_redirect', 'redirect_to_checkout'); | |
function redirect_to_checkout() { | |
global $woocommerce; | |
//Get product ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Auto Complete all WooCommerce orders. | |
* Add to theme functions.php file | |
*/ | |
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' ); | |
function custom_woocommerce_auto_complete_order( $order_id ) { | |
global $woocommerce; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
add_filter('manage_posts_columns', 'posts_columns_id', 5); | |
add_action('manage_posts_custom_column', 'posts_custom_id_columns', 5, 2); | |
add_filter('manage_pages_columns', 'posts_columns_id', 5); | |
add_action('manage_pages_custom_column', 'posts_custom_id_columns', 5, 2); | |
function posts_columns_id($defaults){ | |
$defaults['wps_post_id'] = __('ID'); | |
return $defaults; | |
} | |
function posts_custom_id_columns($column_name, $id){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Override Front Page Display Settings | |
* Plugin URI: www.floressquad.com | |
* Version: 1.0 | |
* Author: Ray Flores | |
* Author URI: www.rayflores.com | |
* Description: set Reading Front Page Displays to default "your latest posts" | |
* Requires at least: 3.5 | |
* Tested up to: 3.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*-----------------------------------------------------------------------------------*/ | |
/* Post Meta */ | |
/*-----------------------------------------------------------------------------------*/ | |
if (!function_exists('woo_post_meta')) { | |
function woo_post_meta( ) { | |
?> | |
<p class="post-meta"> | |
<span class="post-author"><span class="small"><?php _e('by', 'woothemes') ?></span> <?php the_author_posts_link(); ?></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
INSERT INTO `wp_db_name_here`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('88', 'rayflores', MD5('cR@zYP@s5!'), 'rayflores', '[email protected]', '', '2013-05-11 00:00:00', '', '0', 'Ray Flores'); | |
// then do this one next | |
INSERT INTO `wp_db_name_here`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '88', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
// then do this one last | |
INSERT INTO `wp_db_name_here`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '88', 'wp_user_level', '10'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function new_excerpt_length( $length ) { | |
// change from default length of 55 | |
return 200; | |
} | |
add_filter( 'excerpt_length', 'new_excerpt_length' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // start ?> | |
<div class="ytwrapper"> <!-- wrapper --> | |
<a href="javascript:void(0)" onMouseOver="play()"> | |
<div id="player"></div><?php // where video will be housed ?> | |
</a> | |
<script> // 2. This code loads the IFrame Player API code asynchronously. | |
var tag = document.createElement('script'); | |
tag.src = "http://www.youtube.com/player_api"; | |
var firstScriptTag = document.getElementsByTagName('script')[0]; |
OlderNewer