Skip to content

Instantly share code, notes, and snippets.

@jo-snips
jo-snips / custom-wp-seo-titles.php
Last active October 10, 2015 15:18
The Events Calendar: Custom Titles w/WP SEO
<?php
add_filter('wpseo_title','my_custom_titles');
function my_custom_titles($title) {
if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
return 'Events Calendar';
} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages
return 'Events Calendar' . ' &raquo; ' . single_term_title('', false);
} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List
return 'Events List';
@nbouvrette
nbouvrette / inputTypeNumberPolyfill.js
Last active March 28, 2023 11:26
Stand alone JavaScript polyfill allow only numbers on input of type number.
/**
* Stand alone polyfill allow only numbers on input of type number.
*
* While input filtering is already supported by default by some browsers, maximum length has not been implemented by
* any. This script will solve both issue and make sure that only digits can be entered in input elements of type
* number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on
* input of type text.
*
* Supports:
*