Skip to content

Instantly share code, notes, and snippets.

View richstrauss's full-sized avatar

Rich Strauss richstrauss

View GitHub Profile
@richstrauss
richstrauss / gp-cpt-next-previous.php
Last active December 17, 2017 15:19
GeneratePress Custom Post Type Previous/Next Navigation & Entry Meta
<?php
// Single Custom Post Type >> https://generatepress.com/forums/topic/nextprevious-post-links-on-cpt/#post-326390
add_action( 'generate_after_entry_content', 'tu_custom_post_type_post_nav' );
function tu_custom_post_type_post_nav() {
if ( 'my-post-type' == get_post_type() ) : ?>
<footer class="entry-meta">
<?php generate_entry_meta(); ?>
<?php if ( is_single() ) generate_content_nav( 'nav-below' ); ?>
@richstrauss
richstrauss / custom-icon.html
Created October 11, 2016 19:41
Custom Font Awesome Icon 001
<div class="icon-wrapper"><i class="fa fa-users custom-icon"></i></div>
@richstrauss
richstrauss / functions.php
Created October 10, 2016 13:36
Enqueue Zozo Tabs and Accordion Scripts
<?php
/**
* Enqueue Zozo Tabs and Accordion Scripts
*/
add_action( 'wp_enqueue_scripts', 'zozo_enqueue_scripts' );
function zozo_enqueue_scripts()
{
@richstrauss
richstrauss / functions.php
Created October 10, 2016 13:35
Change WooCommerce endpoints order on 'My Account' page
<?php
/*
* Change the order of the endpoints that appear in My Account Page - WooCommerce 2.6
* The first item in the array is the custom endpoint URL - ie http://mydomain.com/my-account/my-custom-endpoint
* Alongside it are the names of the list item Menu name that corresponds to the URL, change these to suit
*/
function wpb_woo_my_account_order() {
$myorder = array(
@richstrauss
richstrauss / functions.php
Last active October 10, 2016 13:32
LearnDash Breadcrumbs with Uncanny LearnDash Toolkit Plugin and Genesis
<?php
// LearnDash Breadcrumbs with Uncanny LearnDash Toolkit Plugin and Genesis
// https://wordpress.org/plugins/uncanny-learndash-toolkit/
// Code goes into functions.php
add_action( 'genesis_before', 'wpe_remove_genesis_breadcrumbs_courses' );
function wpe_remove_genesis_breadcrumbs_courses() {
if ('sfwd-courses' == get_post_type()) {//add in your CPT name
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
@richstrauss
richstrauss / functions.php
Created October 10, 2016 13:20
Genesis: Remove Post Info, Post Meta from Custom Post Types
<?php
// Remove Post Info, Post Meta from Courses
add_action ( 'get_header', 'wpe_remove_post_info_course' );
function wpe_remove_post_info_course() {
if ('sfwd-courses' == get_post_type()) {//add in your CPT name
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
}
}
@richstrauss
richstrauss / functions.php
Last active October 10, 2016 13:18
Remove Disqus Comments from Custom Post Types
<?php
// Remove Disqus from Courses custom post type
add_filter( 'comments_template' , 'wpe_block_disqus_courses', 1 );
function wpe_block_disqus_courses($file) {
if ( 'sfwd-courses' == get_post_type() )
remove_filter('comments_template', 'dsq_comments_template');
return $file;
}
@richstrauss
richstrauss / better-forum-list-widget.php
Created October 10, 2016 10:22
Better Forum List Widget for bbPress
<?php
/*
Plugin Name: Better Forum List Widget for bbPress
Description: The default bbPress Forum List widget is pretty bare bones. This plugin adds a topic count and organizes the forum categories differently.
Author: c.bavota
Version: 1.0.0
Author URI: http://www.bavotasan.com/
https://code.tutsplus.com/tutorials/a-better-forum-list-widget-for-bbpress--wp-32279
*/
@richstrauss
richstrauss / wp-config.php
Created October 8, 2016 14:55
Amazon Web Services and WP Offload S3 define AWS access key and secret key.
// https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/
// To use the Amazon Web Services plugin and it’s addon WP Offload S3 you need to define an AWS access key and secret key.
define( 'AWS_ACCESS_KEY_ID', '####################' );
define( 'AWS_SECRET_ACCESS_KEY', '########################################' );
@richstrauss
richstrauss / tinted-image.css
Created October 8, 2016 10:23
Tinted Image w/ Multiple Backgrounds
.tinted-image {
width: 300px;
height: 200px;
background:
/* top, transparent red */
linear-gradient(
rgba(255, 0, 0, 0.45),
rgba(255, 0, 0, 0.45)