Skip to content

Instantly share code, notes, and snippets.

View tacoverdo's full-sized avatar

Taco Verdonschot tacoverdo

View GitHub Profile
@tacoverdo
tacoverdo / disable_googles_ssb.php
Last active February 5, 2022 14:19
Disable Google's Sitelink Search Box in WordPress SEO (Premium)
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
// This disables the Google Sitelink Search Box functionality in WordPress SEO (Premium)
add_filter('disable_wpseo_json_ld_search', '__return_true');
@tacoverdo
tacoverdo / disable_transient_caching.php
Last active October 3, 2020 21:34
Disable WordPress SEO transient caching
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/**
* Disables the XML Sitemap transient caching in WordPress SEO and WordPress SEO Premium.
* WARNING: This may lead to a heavier load on your server and your sitemaps being loaded less fast.
*/
add_filter( 'wpseo_enable_xml_sitemap_transient_caching', '__return_false' );
@tacoverdo
tacoverdo / yoast_seo_breadcrumbs_replace_woocommerce.php
Last active October 3, 2020 21:33 — forked from amboutwe/yoast_seo_breadcrumbs_replace_woocommerce_storefront.php
There are two sets of code in this gist. One for non-WooThemes and one for WooThemes. Only copy the section you need to replace breadcrumbs
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Replace WooCommerce Breadcrumbs With Yoast Breadcrumbs
* Credit: Unknown
* Last Tested: Jan 25, 2018 using Yoast SEO 6.2 on WordPress 4.9.2
* Theme: Non-WooThemes like Twenty Seventeen, Genesis
*/
// Remove WooCommerce Breadcrumbs
@tacoverdo
tacoverdo / change_url_googles_ssb.php
Last active June 19, 2019 20:33
change_url_googles_ssb.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/**
* Changes the URL used for the Google Sitelink Search Box functionality in WordPress SEO (Premium)
* The returned string must always include {search_term} to indicate where the search term should be used.
*
* @returns string new searchURL
*/
function yoast_change_ssb_search() {
@tacoverdo
tacoverdo / i18n-q-link.php
Last active November 13, 2017 07:56
What is the best way to translate a text with hyperlink?
@tacoverdo
tacoverdo / replace_woocommerce_bc.php
Created March 6, 2017 13:29
Replace WooCommerce breadcrumbs with Yoast breadcrumbs
<?php
// Both woo_breadcrumbs() and Yoast breadcrumbs need to be enabled in the WordPress admin for this to function.
add_filter( 'woo_breadcrumbs', 'woo_custom_use_yoast_breadcrumbs' );
function woo_custom_use_yoast_breadcrumbs( $breadcrumbs ) {
if ( function_exists( 'yoast_breadcrumb' ) ) {
$before = '<div class="breadcrumb breadcrumbs woo - breadcrumbs"><div class="breadcrumb - trail">';
$after = '</div></div>';
$breadcrumbs = yoast_breadcrumb( $before, $after, false );
}
return $breadcrumbs;
@tacoverdo
tacoverdo / howto_preanalysis_post_content.php
Created September 16, 2013 08:42
How to use wpseo_pre_analysis_post_content in WP SEO by Yoast?
<?php
/**
* Add (custom field) content to the post's content before WP SEO Analysis.
*
* @param string $content The content of a posts content-field.
*
* @return string The original content plus the value of the postmeta with meta_key '_yoast_postmeta_example'.
*/
function yst_custom_content_analysis( $content ) {
global $post;
<p>[et_pb_section admin_label="Section" fullwidth="off" specialty="off" transparent_background="on" allow_player_pause="off" inner_shadow="on" parallax="off" parallax_method="off" padding_mobile="off" make_fullwidth="off" use_custom_width="off" width_unit="on" make_equal="off" use_custom_gutter="off" gutter_width="3"][et_pb_row admin_label="Row" make_fullwidth="off" use_custom_width="off" width_unit="on" use_custom_gutter="off" padding_mobile="off" allow_player_pause="off" parallax="off" parallax_method="off" make_equal="off" parallax_1="off" parallax_method_1="off" column_padding_mobile="on" custom_margin="0px||0px|" custom_padding="||10px|"][et_pb_column type="4_4"][et_pb_blurb admin_label="Blurb" url_new_window="off" use_icon="on" icon_color="#005275" use_circle="off" circle_color="#1d1aeb" use_circle_border="off" circle_border_color="#1d1aeb" icon_placement="top" animation="top" background_layout="dark" text_orientation="center" use_icon_font_size="on" background_color="rgba(0,82,117,0.2)" use_border_colo
Verifying that +tacoverdo is my blockchain ID. https://onename.com/tacoverdo
ystThemeConfigL10n = { choose_image: "Use Image"};
// Taken and adapted from http://www.webmaster-source.com/2013/02/06/using-the-wordpress-3-5-media-uploader-in-your-plugin-or-theme/
jQuery(document).ready(function ($) {
var yst_custom_uploader;
var yst_target_id;
$('.yst_image_upload_button').click(function (e) {
yst_target_id = e.currentTarget.id.replace(/_button$/, '_input');
e.preventDefault();
if (yst_custom_uploader) {