Skip to content

Instantly share code, notes, and snippets.

View lelandf's full-sized avatar

Leland Fiegel lelandf

View GitHub Profile
@lelandf
lelandf / custom.css
Created August 14, 2016 11:52
Adaline + The Events Calendar
#tribe-events-pg-template {
max-width: calc(600px + 10%);
padding-left: 5%;
padding-right: 5%;
padding-top: 70px;
}
.tribe-events-page-title {
clear: both;
}
@lelandf
lelandf / functions.php
Created September 29, 2016 02:37
Vivaro Date Alternate
if ( ! function_exists( 'vivaro_date_alternate' ) ) :
/**
* Prints HTML with alternate current post-date/time or sticky designator.
*/
function vivaro_date_alternate() {
$time_string = '<time class="entry-date published updated" datetime="%1$s"><span>%2$s</span> %3$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s"><span>%2$s</span> %3$s</time><time class="updated" datetime="%4$s"><span>%5$s</span> %6$s</time>';
}
@lelandf
lelandf / milan-custom-fonts.php
Last active November 10, 2016 13:50
Rudimentary plugin that allows you to load different Google Fonts in Milan Pro.
<?php
/*
Plugin Name: Milan Custom Fonts
Plugin URI: https://gist.github.com/lelandf/1e1714d99e68db38696539d530f1fec2
Description: Rudimentary drop-in mu-plugin that allows you to load different Google Fonts in Milan Pro.
Version: 1.0.0
Author: Themetry
Author URI: https://themetry.com
*/
@lelandf
lelandf / style.html
Created February 13, 2017 20:49
Style tag contents for new header image in Beautiful Pro
<style>
body.custom-background .site-header-banner {
background-image: url('http://beautiful.dev/wp-content/uploads/beautiful-header-1.jpg');
}
</style>
@lelandf
lelandf / style.css
Last active February 13, 2017 21:33
Customize Beautiful Pro header image
.postid-1.custom-background .site-header-banner {
background-image: url('http://beautiful.dev/wp-content/uploads/beautiful-header-1.jpg');
}
function theme_slug_header_style() {
/*
* If header text is set to display, let's bail.
*/
if ( display_header_text() ) {
return;
}
// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css">
@lelandf
lelandf / front-page.php
Created February 27, 2019 12:42
Milan Pro front-page.php with static page
<?php
/**
* This file adds customizations to the front page template on the Milan Pro Theme.
*
* @author Themetry
* @package Milan
* @subpackage Customizations
*/
//* Add Featured Content widget area to blog index page
<?php
// UPDATE: I wouldn't use this anymore
// UPDATE: I would use this instead: https://developers.learndash.com/constant/learndash_default_course_price_type/
function leland_learndash_set_default_course_access_setting( $options_fields ) {
global $pagenow;
if ( "post-new.php" === $pagenow && "sfwd-courses" === get_post_type() ) {
@lelandf
lelandf / leland_learndash_public_groups.php
Last active March 25, 2020 11:40
Publicize LearnDash groups
function leland_learndash_public_groups( $args, $post_type ) {
// Based off of this: https://gregrickaby.com/2016/06/modify-wordpress-custom-post-type/
// If not Groups CPT, bail.
if ( 'groups' !== $post_type ) {
return $args;
}
// Add additional Products CPT options.
$groups_args = array(
/* No warranty or support offered. Please use at your own risk */
function leland_learndash_update_course_meta() {
$course_args = array(
'post_type' => 'sfwd-courses',
// Please be careful with unbounded queries
// This is not going to work well if you have a lot of courses
// Test on a staging/dev server first!
'posts_per_page' => -1,