Skip to content

Instantly share code, notes, and snippets.

View 5t3ph's full-sized avatar

Stephanie Eckles 5t3ph

View GitHub Profile
@5t3ph
5t3ph / gist:f87dad1fac5f6d920c1a
Last active August 29, 2015 14:08
WordPress WP_User_Query Transient Array Search
<?php
/*
* WordPress WP_User_Query Transient Array Search
*
* Purpose: To search array of relevant user fields
* stored as an array in a transient
*
* Example Array:
* [userid] => array (
'0' => 'first_name',
@5t3ph
5t3ph / cpt-search-results
Last active August 29, 2015 14:20
WordPress: Customize CPT Search Results
/*
* For use when you have a custom page to display a custom post type but also need the CPT pulled into search results.
*
* Includes functions hooked to filters to alter the title, permalink, and excerpt.
* Uses switch statements for easily extending to additional custom post types.
*
*/
<?php
/**
@5t3ph
5t3ph / gatsby-custom-markdown-components.tsx
Last active January 4, 2019 15:07
Gatsby Custom Markdown Components - prevent wrapping with paragraph
/* Review the following article for more info on getting started with custom components.
* @link https://using-remark.gatsbyjs.org/custom-components/
*
* Example here demonstrates detecting if a custom component is being used
* If so, do not wrap it with a paragraph tag and invalidate DOM nesting
*/
import * as React from 'react';
import rehypeReact from 'rehype-react';
@5t3ph
5t3ph / gatsby-fetch-permalink.tsx
Created January 7, 2019 20:11
Gatsby - Fetch permalink based on known slug
@5t3ph
5t3ph / gatsby-useImgSrc-hook.tsx
Last active March 10, 2020 16:46
Gatsby useStaticQuery to create custom hook for returning an image src path
/**
* Required plugins: gatsby-source-filesystem and gatsby-plugin-sharp
*
* Basic Hook Usage:
*
* import useImgSrc from '../utils/useImgSrc';
*
* const Image = ({src}) => {
* const imgSrc = useImgSrc(src);
*
@5t3ph
5t3ph / stylestage.html
Last active July 5, 2020 22:07
[DRAFT] Style Stage source HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>[Your Style Title] by [Your Name] | Style Stage</title>
<meta name="description" content="[Your optional description]" />
<link href="style.css" rel="stylesheet" />
</head>
<body>
@5t3ph
5t3ph / style-stage-guidelines.md
Last active July 7, 2020 16:43
[DRAFT] Style Stage Guidelines

The HTML for this page was created to be semantic, accessible, and free of nearly all other opinions. While typically extra divs are to be avoided, each sectioning element also includes a .container div as the first child for use as a styling aid since you do not have access to alter the base HTML. IDs are included where needed for nav anchors or accessibility, and a small number of additional classes are provided for key elements without IDs.

As a contributor, you agree to abide by the following guidelines and restrictions:

  • Branding is prohibited with the exception of Monthly and Weekly sponsors.
  • The HTML is not available to modify, except for attribution values that will be added from your submission metadata.
  • You may use any build setup you prefer to create your stylesheet, but the final submission should be the compiled, unminified CSS.
@import url("https://fonts.googleapis.com/css2?family=Red+Rose:wght@700&family=Roboto+Slab:wght@400;600&display=swap");
:root {
--color-primary: #ef8994;
--color-secondary: #e5ce94;
--color-background: #013785;
--color-text: #e8b9c0;
--color-light: #fff;
--color-anchor: var(--color-primary);
--color-highlight: #fffb4a;
/* Place in your _data directory to create an Eleventy data source from an RSS feed
* View package docs for full available parsed schema: https://www.npmjs.com/package/rss-parser
*
* TO USE in Nunjucks assuming a filename of `rssposts`
*
* {% for post in rssposts %}
* <article>
* <h3>
* <a href="{{ post.url }}">{{ post.title }}</a>
* </h3>
<form>
<fieldset>
<legend>Full Name</legend>
<div class="form-field">
<label for="firstname">First Name</label>
<input type="text" id="firstname" />
</div>
<div class="form-field">
<label for="lastname">Last Name</label>
<input type="text" id="lastname" />