Skip to content

Instantly share code, notes, and snippets.

View 1wdtv's full-sized avatar

1WD.tv - Make Money With Divi 1wdtv

View GitHub Profile
@1wdtv
1wdtv / gist:0bbeff43d8103ef0e284d24ede60aea6
Created May 10, 2017 05:55 — forked from hissy/gist:3613306
[WordPress] change next / previous post link ordering
<?php
/**
* Customize Adjacent Post Link Order
*/
function my_custom_adjacent_post_where($sql) {
if ( !is_main_query() || !is_singular() )
return $sql;
$the_post = get_post( get_the_ID() );
$patterns = array();
@1wdtv
1wdtv / child-theme-functions-php-snippet.php
Created February 28, 2017 01:02 — forked from lots0logs/child-theme-functions-php-snippet.php
WordPress :: Divi Theme :: Disable Default Open Sans Font
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function et_divi_fonts_url() {
$fonts_url = '';
/* Translators: If there are characters in your language that are not
* supported by Open Sans, translate this to 'off'. Do not translate
* into your own language.
*/
@1wdtv
1wdtv / gist:eff589a45d1cd31d9d86
Last active January 23, 2016 17:17 — forked from pippinsplugins/gist:4651510
Modify EDD Download History To Add Thumbnails for products
<?php
$purchases = edd_get_users_purchases( get_current_user_id(), 20, true );
if( $purchases ) :
do_action( 'edd_before_download_history' ); ?>
<table id="edd_user_history">
<thead>
<tr class="edd_download_history_row">
<?php do_action( 'edd_download_history_header_start' ); ?>
<th class="edd_download_download_name"><?php _e( 'Download Name', 'edd' ); ?></th>
<?php if( ! edd_no_redownload() ) { ?>
@1wdtv
1wdtv / gist:a3c6740bee3fb50926e5
Created November 23, 2015 16:01 — forked from rolandinsh/gist:5636349
wp_new_user_notification() - wordpress new user notification message on register
<?php
if ( !function_exists( 'wp_new_user_notification' ) ) {
function wp_new_user_notification( $studentID, $plaintext_pass = '' ) {
$student = new WP_User($studentID);
$student_data = get_userdata( $studentID );
$firstname = $student_data->first_name;
$student_login = stripslashes( $student_data->user_login );
// URLs
$site_url = site_url();
@1wdtv
1wdtv / auto-login-from-reg-email.php
Created November 23, 2015 06:29 — forked from butlerblog/auto-login-from-reg-email.php
WordPress auto login from native registration email
<?php
/*
This code snippet can be added to your functions.php file (without the <?php)
to add a query string to the login link emailed to the user upon registration
which when clicked will validate the user, log them in, and direct them to
the home page.
*/
/**
* This first function is hooked to the 'user_register' action which fires
@1wdtv
1wdtv / 0_reuse_code.js
Created November 12, 2015 21:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
// Run this code on 'after_theme_setup', when plugins have already been loaded.
add_action('after_setup_theme', 'my_load_plugin');
// This function loads the plugin.
function my_load_plugin() {
// Check to see if your plugin has already been loaded. This can be done in several
// ways - here are a few examples:
<?php
/*
* Get the most recently replied-to topics, and their most recent reply
*/
function custom_bbpress_recent_replies_by_topic($atts){
$short_array = shortcode_atts(array('show' => 5, 'forum' => false, 'include_empty_topics' => false), $atts);
extract($short_array);
// default values
<?php
/*
Plugin Name: PMPro stop downgrade level
Plugin URI: https://gist.github.com/1wdtv/a6d8a45979e4e217d212
Description: Prevent existing paid members from downgrading to free level (eg: when registering from a webinar).
Version: 1
Author: 1WD.tv
Author URI: https://1wd.tv
*/
/*