Skip to content

Instantly share code, notes, and snippets.

View s-a-s-k-i-a's full-sized avatar
🥰

Saskia Lund s-a-s-k-i-a

🥰
View GitHub Profile
@devinsays
devinsays / ActionSchedulerHighVolume.php
Last active March 24, 2023 14:25
Modifications to Action Scheduler in order to run higher volumes of actions.
<?php
/**
* High volume modifications to Action Scheduler.
*
* Adapted from https://github.com/woocommerce/action-scheduler-high-volume/
*
* Increase Action Scheduler batch size, concurrency, timeout period, and claim action query
* ORDER BY to process large queues of actions more quickly on servers with more server resources.
*
* @package UniversalYums\ActionScheduler
@s-a-s-k-i-a
s-a-s-k-i-a / functions.php
Last active July 9, 2019 10:30
WordPress: List Category Posts feat. Yoast SEO while using custom category.php with catlist shortcode
/*
* @author Saskia Lund
* @authorurl https://www.saskialund.de/
*
* When Yoast SEO and List Category Posts are activated alongside each other,
* there is an issue regarding canonicals and rel=next and rel=prev urls displayed in head html.
* List Category Posts is making use of its own pagination methods, while Yoast SEO is being WP codex compliant
* and is making use of WP pagination methods.
*
* Preparations
@amboutwe
amboutwe / yoast_seo_canonical_change_woocom_shop.php
Last active April 11, 2024 02:02
Code snippets for the Yoast SEO canonical output
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change the canonical link for the shop page
* Credit: Scott Weiss of somethumb.com
* Yoast Doc: https://developer.yoast.com/features/seo-tags/canonical-urls/api/
* Last Tested: Jan 25 2017 using Yoast SEO 6.0 on WordPress 4.9.1
*/
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_woocom_shop', 10, 1 );
@andrasguseo
andrasguseo / et-meta-hawk.php
Created November 30, 2016 15:44
Event Tickets Meta Hawk by Barry
<?php
/**
* Plugin name: Event Tickets Meta Hawk
* Description: Lets site administrators soar over attendee meta data supplied by attendees then swoop down, hawk-like, to change it. Proof of concept targeting the WooCommerce provider.
* Version: 2016-03-21
* Author: Barry Hughes
*
* Experiment in making attendee meta editable via the attendee screen.
* Well worth bearing in mind that:
*
@amboutwe
amboutwe / yoast_seo_prev_next_change.php
Last active July 7, 2023 19:54
Remove or modify the Yoast SEO prev or next URLs. Only copy the section of code you need.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change Yoast SEO Prev/Next URL on some pages
* Credit: Yoast Team
* Last Tested: Jun 10 2017 using Yoast SEO 4.9 on WordPress 4.8
*/
add_filter( 'wpseo_next_rel_link', 'custom_change_wpseo_next' );
@johnregan3
johnregan3 / wp-amp-tutorial-primary-nav.php
Last active February 13, 2019 16:39
Adding a Primary Navigation Menu to an AMP WordPress Theme
<?php
/**
* Register the amp-sidebar component script with WP AMP.
*
* This goes in your amp.php
*/
function jr3_amp_sidebar_component_script( $data ) {
$data['amp_component_scripts']['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js';
return $data;
}
@sudar
sudar / error_msg.php
Created June 27, 2015 08:10
Creating single select WordPress taxonomies. Explanation at http://sudarmuthu.com/blog/creating-single-select-wordpress-taxonomies/
<?php
/**
* Display an error message at the top of the post edit screen explaining that ratings is required.
*
* Doing this prevents users from getting confused when their new posts aren't published, as we
* require a valid rating custom taxonomy.
*
* @param WP_Post The current post object.
*/
function show_required_field_error_msg( $post ) {