Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dryan1144's full-sized avatar

David Ryan dryan1144

View GitHub Profile
@dryan1144
dryan1144 / mailchimp-firstname-query.php
Last active August 29, 2015 14:07
Pass a merge list variable from Mailchimp to WordPresss and use it in a template
<?php
if (isset($_GET['firstname'])) { //we have a first name to work with
$firstname = $_GET['firstname'];
echo '<p>Hi '.$firstname.', here is your download.</p>';
} else { //there isn't a first name variable, so decide what to do
@dryan1144
dryan1144 / functions.php
Created October 8, 2014 15:32
Change title of Membership Content in iThemes Exchange member's area
<?php
/*
------------------------------------------------------------------------------------------
Change Membership Content to Online Courses on membership content page
------------------------------------------------------------------------------------------
*/
function custom_exchange_membership_content_title( $translated_text ) {
@dryan1144
dryan1144 / functions.php
Last active August 29, 2015 14:07
Add default iThemes Exchange product image
<?php
/*
------------------------------------------------------------------------------------------
Add default thumbnail for products on Store page
------------------------------------------------------------------------------------------
*/
function custom_exchange_default_product_image() {
if ( ! it_exchange( 'product', 'has-featured-image' ) ) { ?>
@dryan1144
dryan1144 / functions.php
Created October 8, 2014 15:51
Remove product thumbnail from iThemes Exchange cart, checkout and confirmation
<?php
/*
------------------------------------------------------------------------------------------
Remove thumbnails from iThemes checkout and order confirmation
------------------------------------------------------------------------------------------
*/
function custom_exchange_get_content_cart_items_elements( $parts ) {
<?php
/*
Change Place Order button text on checkout page in woocommerce
*/
add_filter('woocommerce_order_button_text','custom_order_button_text',1);
function custom_order_button_text($order_button_text) {
@dryan1144
dryan1144 / functions.php
Created April 27, 2015 03:13
Hide pages from search results
<?php
add_filter('pre_get_posts','your_custom_search_filter');
function your_custom_search_filter($query) {
if (!is_admin() && $query->is_search) {
$exclude_ids = array(1,2,3); //page ids you want to exclude
$query->set('post__not_in', $exclude_ids);
}
<?php //Slides loop
$args=array(
'post_type' => 'slide', //this is your cpt name
'post_status' => 'publish',
'posts_per_page' => -1, //this is the max number of slides
'orderby' => 'menu_order',
'order' => 'ASC'
);
$slide_query = new WP_Query($args);
<?php if (is_product() || is_cart() || is_checkout() || is_wc_endpoint_url('order-received')) {
if (is_product()) {
echo '<h1>Register</h1>';
} elseif (is_cart()) {
echo '<h1>Review Order</h1>';
<?php
if (is_product()) {
echo '<h1>Register</h1>';
} elseif (is_cart()) {
echo '<h1>Review Order</h1>';
@dryan1144
dryan1144 / woocommerce-functions.php
Last active December 25, 2018 15:45
Change WooCommerce order confirmation text in
<?php
add_filter( 'woocommerce_thankyou_order_received_text', 'my_custom_order_received_text' );
function my_custom_order_received_text() { ?>
<div class="order-received-text">
<h5>Your Order Was Successful!</h5>
<p>Congratulations and a huge thank you for registering with us!</p>
<p>You will receive a confirmation email shortly. If you have questions, please do not hesitate to <a href="/contact">contact us</a></p>
<p>Thanks again!</p>