Skip to content

Instantly share code, notes, and snippets.

View renventura's full-sized avatar

Ren Ventura renventura

View GitHub Profile
@renventura
renventura / tactile-buttons.css
Created September 24, 2014 05:46
CSS for tactile button links.
a.tactile-button {
display: block;
background: #f4f4f4;
color: #000017;
text-align: center;
padding: 20px 0;
margin-bottom: 10px;
border-radius: 10px;
border-bottom: 4px solid #ccc;
width: 100%;
@renventura
renventura / gf-create-edd-coupons.php
Created October 4, 2014 03:36
Create randomly generated discount codes for Easy Digital Downloads on Gravity Forms submission
<?php //* Mind this opening php tag and header information below
/*
Plugin Name: Create EDD Discounts with Gravity Forms
Plugin URI: http://engagewp.com/create-random-discount-codes-edd-gravity-forms
Description: Allows discount codes for Easy Digital Downloads to be randomly generated on Gravity Forms submissions. Code credit to David Smith of GravityWiz.com. Modified and put into plugin format by Ren Ventura.
Author: David Smith / Ren Ventura
Version: 1.0
*/
@renventura
renventura / remove-category-wc-category-widget.php
Last active May 25, 2020 15:12
Removes an array of product categories from the WooCommerce Product Category Widget.
<?php // Mind this opening php tag
/**
* Remove Categories from WooCommerce Product Category Widget
*
* @author Ren Ventura
*/
//* Used when the widget is displayed as a dropdown
add_filter( 'woocommerce_product_categories_widget_dropdown_args', 'rv_exclude_wc_widget_categories' );
@renventura
renventura / reposition-page-title-before.php
Last active August 29, 2015 14:08
How to Display a Custom Page Title in Genesis (Part 1/3)
<?php //* Mind this opening PHP tag
//* Reposition Page Title
add_action( 'genesis_before', 'centric_post_title' );
function centric_post_title() {
if ( is_page() and !is_page_template() ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_after_header', 'centric_open_post_title', 1 );
add_action( 'genesis_after_header', 'genesis_do_post_title', 2 );
@renventura
renventura / reposition-page-title-after.php
Last active August 29, 2015 14:08
How to Display a Custom Page Title in Genesis (Part 2/3)
<?php //* Mind this opening PHP tag
//* Reposition Page Title
add_action( 'genesis_before', 'centric_post_title' );
function centric_post_title() {
if ( is_page() && !is_page_template() ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_after_header', 'centric_open_post_title', 1 );
add_action( 'genesis_after_header', 'genesis_do_post_title', 2 );
@renventura
renventura / reposition-page-title-additional-functions.php
Created October 24, 2014 17:59
How to Display a Custom Page Title in Genesis (Part 3/3)
<?php //* Mind this opening PHP tag
function centric_open_post_title() {
echo '<div class="page-title"><div class="wrap">';
}
function centric_close_post_title() {
echo '</div></div>';
}
@renventura
renventura / shortcodes-with-custom-fields.php
Created October 28, 2014 22:05
How to Create Shortcodes that Pull Custom Fields
<?php //Mind this opening PHP tag
/****************************************************************
Project Shortcode
****************************************************************/
// Add Project Details Shortcode
add_shortcode( 'project_info', 'project_info' );
function project_info( $atts ) {
@renventura
renventura / edd-software-licensing-changelog-shortcode.php
Last active March 17, 2016 04:08
Store the content of an Easy Digital Downloads licensed download in a shortcode to use anywhere on your WordPress website.
<?php //* Mind this opening PHP tag
/**
* This snippet creates a shortcode that renders the content of a
* licensed download/product's change log in Easy Digital Downloads.
*
* Example: [edd_changelog download_id="0000"] (replace 0000 with the ID of a download post)
*
* @author Ren Ventura <EngageWP.com>
* @link https://www.engagewp.com/include-easy-digital-downloads-software-licensing-change-logs-posts/
@renventura
renventura / cpt-custom-sidebar.php
Created November 6, 2014 18:08
Replace the Primary Sidebar in Genesis with a custom sidebar for custom post types
<?php //* Mind this opening PHP tag
/**
* Register the sidebar for our CPT
* Goes in functions.php
*/
genesis_register_sidebar( array(
'id' => 'project-sidebar',
'name' => __( 'Project Sidebar', 'textdomain' ),
@renventura
renventura / cot-home-page.php
Created November 21, 2014 01:45
Show recent custom post types on your blog's home page rather than Posts.
<?php //* Mind the opening PHP tag
/*
* Changes the main query on the home page (blog posts index) to one or more custom post types
*/
add_filter( 'pre_get_posts', 'my_custom_query' );
function my_custom_query( $query ) {
if ( $query->is_main_query() && $query->is_home() ) {