Skip to content

Instantly share code, notes, and snippets.

Angie Vale PurpleHippoDesign

Block or report user

Report or block PurpleHippoDesign

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@PurpleHippoDesign
PurpleHippoDesign / acf-gutenberg-blocks.php
Created Jun 10, 2019
Add colours to ACF colour picker
View acf-gutenberg-blocks.php
function themeprefix_acf_input_admin_footer() {
?>
<script type="text/javascript">
(function($) {
acf.add_filter('color_picker_args', function( args, $field ){
// add the hexadecimal codes here for the colors you want to appear as swatches
args.palettes = ['#F0F4F9', '#FFFBC5']
View remove-taxonomy-base.php
<?php
add_filter("request", "ph_change_term_request", 1, 1);
function ph_change_term_request($query)
{
$tax_name = "my_tax_name";
if (isset($query["attachment"]))
{
$include_children = true;
$name = $query["attachment"];
@PurpleHippoDesign
PurpleHippoDesign / create-sub-pages-for-custom-post-type.php
Created Sep 5, 2018
Creates 'fake' sub-pages for custom post types in WordPress. In this example we are creating 3 sub-pages called "About", "People" and "Information" for the CPT "department"
View create-sub-pages-for-custom-post-type.php
<?php
/*
* Creates fake sub pages for a custom post type.
*/
// Create 'Fake sub-pages' permalinks and titles.
$sub_pages = array(
'about' => 'About',
'people' => 'People',
'information' => 'Information',
@PurpleHippoDesign
PurpleHippoDesign / page-header.php
Created Sep 3, 2018
Moves titles for pages, posts, page for posts, archives, custom post type archives, category, tag and author archives into the header and wraps in markup
View page-header.php
<?php
//* Add opening markup for the Page Header
add_action( 'genesis_before_header', 'wwd_opening_page_header' );
function wwd_opening_page_header() {
if (is_front_page() || is_search() || is_404() ) {
return;
}
View genesis-archive-title-removal.php
<?php //<~ Remove me
//Removes Title and Description on CPT Archive
remove_action( 'genesis_before_loop', 'genesis_do_cpt_archive_title_description' );
//Removes Title and Description on Blog Archive
remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' );
//Removes Title and Description on Date Archive
remove_action( 'genesis_before_loop', 'genesis_do_date_archive_title' );
//Removes Title and Description on Archive, Taxonomy, Category, Tag
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
@PurpleHippoDesign
PurpleHippoDesign / remove-archive-title-prefixes.php
Last active Sep 3, 2018
Remove archive title prefix from WordPress archive title
View remove-archive-title-prefixes.php
<?php //<~ Remove me
/**
* Remove archive title prefixes.
*
* @param string $title The archive title from get_the_archive_title();
* @return string The cleaned title.
*/
function ph_custom_archive_title( $title ) {
@PurpleHippoDesign
PurpleHippoDesign / retina-media-query.css
Last active Aug 29, 2015
Add retina logo to Genesis
View retina-media-query.css
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
.header-image .site-title > a {
float: left;
min-height: 133px;
View display-gallery-as-soliloquy-dynamic-slider.php
@PurpleHippoDesign
PurpleHippoDesign / single-cpt.php
Last active Jan 27, 2017
Generate slideshow from ACF gallery field via Soliloquy Dynamic
View single-cpt.php
<?php
add_action( 'genesis_entry_content', 'pbh_do_post_content', 9 );
function pbh_do_post_content() {
echo '<div class="slider-container">';
// If at least 1 image is present in the Project Images Gallery field
if( $images = get_field('gallery') ) {
@PurpleHippoDesign
PurpleHippoDesign / screen-reader-text-class.css
Last active Jan 10, 2016
CSS to hide anchor text for accessibility
View screen-reader-text-class.css
a span.screen-reader-text {
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
You can’t perform that action at this time.