Skip to content

Instantly share code, notes, and snippets.

View tpitre's full-sized avatar
💭
🍕

TJ Pitre tpitre

💭
🍕
View GitHub Profile
@tpitre
tpitre / wp-cli-csv-import.sh
Last active March 14, 2023 17:23
WP CLI CSV Import with Terminus
# Loop through the CSV file and run the WP CLI command
while IFS=, read orig new; do
terminus wp pom-ool.dev --skip-themes --skip-plugins search-replace "$orig" "$new" wp_posts --include-columns=post_content --verbose
done < ool-cleanup-tab1-2.csv
@tpitre
tpitre / card.twig
Last active September 20, 2022 13:36
WP Timber/Twig Example Usage - Card Component Twig Include
{% if card %}
<div class="c-card{{ card.classes ? ' ' ~ card.classes }}">
{% include "@atoms/images/image/figure.twig" with {
"figure": {
"link": {
"url": card.link
},
"image": {
"src": card.thumbnail.src,
"alt": card.thumbnail.alt
@tpitre
tpitre / card-grid.twig
Created September 20, 2022 13:35
WP Timber/Twig Example Usage - Card Grid Twig Include
{% if card_grid %}
<section class="c-card-grid{{ card_grid.classes ? ' ' ~ card_grid.classes }}">
<div data-bp="container">
<div class="l-wrap">
<div class="c-card-grid__container u-spacing">
{% if card_grid.heading or card_grid.dek %}
<div class="c-card-grid__header l-conatiner--m u-spacing--half">
{% include "@atoms/text/heading/heading.twig" with {
"heading": {
@tpitre
tpitre / archive.twig
Last active September 20, 2022 13:35
WP Timber/Twig Example Usage - Archive Twig Template
{# Pull in the layout wrapper #}
{% extends "@templates/_layout.twig" %}
{# Fill in the "content" block defined in _layout.twig #}
{% block content %}
<div class="c-content{{ content.classes ? ' ' ~ content.classes }} u-spacing--and-half u-space--bottom">
<div data-bp="container">
<div class="l-wrap">
@tpitre
tpitre / archive.php
Last active September 20, 2022 13:23
WP Timber/Twig Example Usage - Archive WP Template
<?php
/**
* The template for main archive pages.
*
* Methods for TimberHelper can be found in the /lib sub-directory
*
* @package WordPress
* @subpackage Timber
* @since Timber 0.1
*/
@tpitre
tpitre / README.md
Last active November 5, 2021 16:51
Storybook (Vue) Component UI Dependencies and Deployment Steps

Andover component library

Storybook for Vue component libary for rapid development.

Dependecies

This component library utilizes the following dependecies.

@tpitre
tpitre / pom-social-share.html
Last active March 12, 2021 16:58
POM Social Share Widget
<div class="o-mini-modal o-mini-modal--share u-background-color--secondary u-corner-rounded u-align--center">
<div class="o-mini-modal__inner">
<button class="o-mini-modal__close o-close o-icon u-icon--s js-toggle" data-remove-class="share-modal-is-active">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
<polygon points="30 28.349 16.652 15.001 29.999 1.653 28.349 0 15 13.349 1.652 0.001 0 1.652 13.349 15 0.001 28.349 1.652 30 15 16.652 28.348 29.999 30 28.349"></polygon>
</svg>
</button>
<h3 class="u-font--body u-space--bottom">Share this</h3>
<div class="c-utility-links c-utility-links--share">
<a target="_blank" href="https://facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.womensrunning.com%2Fculture%2Fnews%2Fdesiree-lindens-50k-world-record-attempt%2F?utm_medium=social%26utm_source=facebook%26utm_campaign=onsiteshare" class="c-utility-links__link o-icon o-icon--facebook " data-analytics-event="click" data-analytics-data="{&quot;name&quot;: &quot;
@tpitre
tpitre / xml
Created November 18, 2020 15:53
Byline XML
<wp:term>
<wp:term_id><![CDATA[12068]]></wp:term_id>
<wp:term_taxonomy><![CDATA[byline]]></wp:term_taxonomy>
<wp:term_slug><![CDATA[kristen-seymour]]></wp:term_slug>
<wp:term_parent><![CDATA[]]></wp:term_parent>
<wp:term_name><![CDATA[Kristen Seymour]]></wp:term_name>
<wp:term_description><![CDATA[In general, the problem may happens for failing on <b>DNS lookup</b> . DNS is that network address that translates the website name to its internet address. Most often it causes for not getting the <b>internet connection</b> or misconfigured internet or network settings.
<h2>Heading</h2>
Another reason could be the <b>firewall</b> preventing Google Chrome to load the webpage. Also in those cases, you received the error and it says Error code:]]></wp:term_description>
<wp:termmeta>
@tpitre
tpitre / html
Last active November 11, 2020 01:48
Broken Oxygen markup for tabular data
URLs:
https://vip.pocketoutdoormedia.com/oxygenmag/2020/02/24/get-to-know-the-60-day-metabolic-reset-coaches/
https://www.oxygenmag.com/metabolic-reset/get-to-know-the-60-day-metabolic-reset-coaches
https://vip.pocketoutdoormedia.com/oxygenmag/2020/10/14/the-any-goal-meal-plan/
https://www.oxygenmag.com/metabolic-reset/get-to-know-the-60-day-metabolic-reset-coaches
<div tml-table="" tml-table-headings="[&quot;Exercises&quot;,&quot;Time&quot;]" tml-table-content="[[&quot;
@tpitre
tpitre / wp-image-import.php
Last active September 23, 2020 20:23
WP image fetching and attaching to post
function process_image() {
$response = '';
$data[] = '';
$error = 0;
if ( isset( $_POST['ids'] ) )
$ids = $_POST['ids'];
$data['choose-tool'] = $_POST['args'];