Skip to content

Instantly share code, notes, and snippets.

David Ryan dryan1144

Block or report user

Report or block dryan1144

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dryan1144
dryan1144 / remove-wp-version.php
Last active Aug 29, 2015
Remove WP version from header
View remove-wp-version.php
//Place in functions.php
//removes WP version from header
function healingartsweb_remove_version() {
return '';
}
add_filter('the_generator', 'healingartsweb_remove_version');
@dryan1144
dryan1144 / output-blog-content.php
Last active Aug 29, 2015
Add blog page content before posts
View output-blog-content.php
<?php
/*
----------------------------------------------------------------------------------
Ouput content for blog page (Settings > Static page > posts page) page above posts
----------------------------------------------------------------------------------
*/
function wphandcrafted_add_blog_page_content() {
if ( is_home() ) {
@dryan1144
dryan1144 / mailchimp-firstname-query.php
Last active Aug 29, 2015
Pass a merge list variable from Mailchimp to WordPresss and use it in a template
View mailchimp-firstname-query.php
<?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 Oct 8, 2014
Remove product thumbnail from iThemes Exchange cart, checkout and confirmation
View functions.php
<?php
/*
------------------------------------------------------------------------------------------
Remove thumbnails from iThemes checkout and order confirmation
------------------------------------------------------------------------------------------
*/
function custom_exchange_get_content_cart_items_elements( $parts ) {
@dryan1144
dryan1144 / functions.php
Created Oct 8, 2014
Change title of Membership Content in iThemes Exchange member's area
View functions.php
<?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 Aug 29, 2015
Add default iThemes Exchange product image
View functions.php
<?php
/*
------------------------------------------------------------------------------------------
Add default thumbnail for products on Store page
------------------------------------------------------------------------------------------
*/
function custom_exchange_default_product_image() {
if ( ! it_exchange( 'product', 'has-featured-image' ) ) { ?>
View functions.php
<?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 Apr 27, 2015
Hide pages from search results
View functions.php
<?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);
}
View slides.php
<?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);
View woocommerce-titles.php
<?php
if (is_product()) {
echo '<h1>Register</h1>';
} elseif (is_cart()) {
echo '<h1>Review Order</h1>';
You can’t perform that action at this time.