Skip to content

Instantly share code, notes, and snippets.

Avatar

Angie Vale PurpleHippoDesign

View GitHub Profile
@cparkinson
cparkinson / facetwp-autoindex-child-terms.php
Created May 13, 2020
FacetWP - automatically index all child terms when a parent taxonomy term is checked
View facetwp-autoindex-child-terms.php
/**
* Filter to customize FacetWP, should be pasted in FacetWP's "Custom Hooks" plugin
*
* Made for a "location" FacetWP autocomplete filter that uses a taxonomy "location"
* consisting of parent county terms and child city terms
*
* When indexing, for every post, for the location taxonomy filter,
* Check to see if it has any location taxonomy set
* Check to see if selected location taxonomy has children (i.e. selected county has cities)
* Create a new index row for each child city
@ChrisButterworth
ChrisButterworth / converter.php
Created Sep 5, 2018
Webp converter for WordPress
View converter.php
<?php
namespace Converter;
use WebPConvert\WebPConvert;
class Converter
{
public $lazy = false;
public function __construct($lazy = false)
@paaljoachim
paaljoachim / genesis-featured-image.php
Last active Sep 12, 2019
Featured image for Genesis themes. 1. Sets the featured image. 2. If no featured image get image from category. 3. If no category image then get the first post image. 4. If no post image or category image then sets a fallback image.
View genesis-featured-image.php
@salcode
salcode / .gitignore
Last active Dec 25, 2020
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
View .gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@srikat
srikat / front-page.php
Last active Sep 21, 2017
Front Page Template to show CPT entries in a 3-column grid in Genesis. http://sridharkatakam.com/front-page-template-show-cpt-entries-3-column-grid-genesis/
View front-page.php
<?php
/**
* To display entries from a Custom Post Type on site's front page in a 3-column responsive grid.
* URL: http://sridharkatakam.com/front-page-template-to-show-cpt-entries-in-a-3-column-grid-in-genesis/
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'sk_do_loop' );
/**
@spivurno
spivurno / gw-gravity-forms-map-fields-to-field.php
Last active Dec 21, 2020
Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
View gw-gravity-forms-map-fields-to-field.php
<?php
/**
* Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
*
* Usage
*
* 1 - Enable "Allow field to be populated dynamically" option on field which should be populated.
* 2 - In the "Parameter Name" input, enter the merge tag (or merge tags) of the field whose value whould be populated into this field.
*
* Basic Fields
@rickrduncan
rickrduncan / genesis-page-titles-html5.php
Last active Dec 9, 2020
How to remove page titles from Genesis child themes using XHTML and HTML5 methods.
View genesis-page-titles-html5.php
<?php
//* Do NOT include the opening php tag
//* ALL EXAMPLES ON THIS PAGE USE THE NEW HTML5 METHOD
//* Remove page titles site wide (posts & pages) (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
@cdils
cdils / proper-table-markup.html
Last active Dec 9, 2018
Bootstrap table styles (See tutorial to add Bootstrap table styles to your theme -> https://carriedils.com/add-bootstrap-table-styles-theme/)
View proper-table-markup.html
<!--
<thead> Groups the header content in a table
<th> Defines a header cell in a table
<tbody> Groups the body content in a table
<td> Defines a cell in a table
-->
<table>
<thead>
@robneu
robneu / wordpress-typekit-enqueue.php
Last active Jun 10, 2019 — forked from FernE97/typekit-enqueue.php
Enqueue typekit fonts to WordPress using wp_enqueue_scripts.
View wordpress-typekit-enqueue.php
<?php
/**
* Enqueue typekit fonts into WordPress using wp_enqueue_scripts.
*
* @author Robert Neu
* @author Eric Fernandez
* @copyright Copyright (c) 2014, Robert Neu
* @license GPL-2.0+
* @link http://typekit.com
*/
@vividvilla
vividvilla / remove-date-from-category.php
Last active Dec 28, 2015
Remove Dates from Posts in Particular Category : Genesis Framework
View remove-date-from-category.php
<?php
//* Do NOT include the opening php tag
//* Customize the entry meta in the entry header */
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
if( in_category( array('cat-1','cat-2') )) {
$post_info = 'Posted by [post_author_posts_link] [post_comments] [post_edit]';
}
else {