Skip to content

Instantly share code, notes, and snippets.

View richstrauss's full-sized avatar

Rich Strauss richstrauss

View GitHub Profile
@richstrauss
richstrauss / floating-back-to-top-button.html
Last active May 6, 2020 04:02
Floating Back to Top Button in the Corner
// http://html-tuts.com/back-to-top-button-jquery/
// Add an anchor link somewhere in your HTML page, by adding a unique class name.
// Preferably add it somewhere outside from any containers, so we can add the fixed position to our floating back to top button.
<a href="#" class="back-to-top">Back to Top</a>
// OR, if you don't have access to html source you can create the link using some jQuery.
// Make sure to add the script below above the ending of </body> tag.
// Don't forget to get jQuery library files and add it above the ending tag of </head>.
@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)
@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 / 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 / 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 / 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: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: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
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 / 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>