Skip to content

Instantly share code, notes, and snippets.

View sewmyheadon's full-sized avatar

Eric Amundson sewmyheadon

View GitHub Profile
@SteveJonesDev
SteveJonesDev / accessible-menu.php
Last active May 21, 2024 13:05
Accessible WordPress Navigation Menu
<div class="menu-container">
<button class="menu-button" aria-expanded="false" aria-controls="site-header-menu" aria-label="<?php esc_attr_e( 'Menu', 'textdomain' ); ?>"></button>
<div id="site-header-menu" class="site-header-menu">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'container' => 'nav',
'container_class' => 'main-navigation',
'container_id' => 'site-navigation',
@sewmyheadon
sewmyheadon / .gitignore
Last active October 18, 2016 21:14 — forked from salcode/.gitignore
.gitignore for WordPress
# -----------------------------------------------------------------
# .gitignore for WordPress ver 20161009
# -----------------------------------------------------------------
#
# This file:
# • is for WordPress sites using the default file/folder structure,
# • specifies which files are tracked/untracked by git.
#
# .gitignore docs:
# https://git-scm.com/docs/gitignore
@llgruff
llgruff / Remove SEO-plugin HTML comments.php
Last active March 4, 2021 13:34
Remove [All in One SEO Pack] or [Yoast SEO] HTML Comments in WordPress (for functions.php)
<?php
/**
* Remove [All in One SEO Pack] HTML Comments
* @link //gist.github.com/llgruff/a7ab776167aa0ed307ec445df54e5fdb
*/
if (defined('AIOSEOP_VERSION')) {
add_action('get_header', function() {
ob_start(
function($o) {
return preg_replace('/\n?<.*?One SEO Pack.*?>/mi','',$o);
@jawinn
jawinn / primary_category.php
Last active December 8, 2022 21:42
Display Primary Category (Yoast's WordPress SEO)
<?php
/**
* Get the Yoast primary category from its post meta value, and displays it, with HTML markup.
* If there is no primary category set, it displays the first assigned category.
*
* @param boolean $useCatLink Whether to link the category, if it exists
* @return void
*/
function yourtheme_display_yoast_primary_category( $useCatLink = true ) {
@drawcard
drawcard / woocommerce-sage-template-part-overrides.md
Last active August 16, 2021 08:39
Woocommerce - Using template part overrides in Sage

So, you know how to override a template file in Woocommerce using Sage, but you're having trouble changing something within the deeper level of that template file. For example, you want to change the output HTML structure of a given part of the product page loop, or incorporate a Bootstrap class into a button element without using Jquery to inject it. Here's how you can override deeper level parts, the default WC theme elements.

Prerequisites

Now you're familiar with how to do Sage + Woocommerce templates, it's time to make it happen.

The template page override

@sewmyheadon
sewmyheadon / .gitignore
Last active August 29, 2015 14:00 — forked from octocat/.gitignore
Basic .gitignore file
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@philiparthurmoore
philiparthurmoore / wporg-theme-developer-handbook-intro.md
Last active January 16, 2016 17:25
The WordPress.org Theme Developer Handbook Introduction

[Note: The style that follows is what I would consider "somewhat conversational American English". Please feel free to edit at will to fit the overall needs of the Theme Developer Handbook introduction.]

[Note: It might make sense to put the "Your First Theme" section just underneath the "Getting Started with WordPress Theme Development" introduction text to give new theme developers an immediate sense of accomplishment for making their first theme.]

Getting Started with WordPress Theme Development

[TODO: Introduction Text]

The GPL

@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@ChromeOrange
ChromeOrange / gist:8287925
Last active February 25, 2020 04:22
Delete all tax rates from WooCommerce
/**
* Delete ALL WooCommerce tax rates
*
* Add to your theme functions.php then go to woocommerce -> system status -> tools and there will be a delete all tax rates button http://cld.wthms.co/tXvp
*/
add_filter( 'woocommerce_debug_tools', 'custom_woocommerce_debug_tools' );
function custom_woocommerce_debug_tools( $tools ) {
$tools['woocommerce_delete_tax_rates'] = array(