To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion
<?php | |
/** | |
* Fix Google Schema error, "The property logo is not recognised by Google for an object of type WPHeader". | |
* | |
* @param string $html The logo HTML. | |
* | |
* @return string The modified HTML. | |
*/ | |
add_filter( 'get_custom_logo', function( $html ) { | |
$html = str_replace( 'itemprop="logo"', 'itemprop="image"', $html ); |
pbpaste | fmt -w 70 | sed -e 's/^/> /' |
<?php | |
add_filter( 'get_the_content_more_link', 'custom_remove_ellipsis' ); | |
/** | |
* Strips the ellipsis from the Genesis more link. | |
* | |
* @param string $more_link_html The current more link HTML. | |
* @return string The link HTML without the ellipsis. | |
*/ | |
function custom_remove_ellipsis( $more_link_html ) { | |
$link_without_ellipsis = str_replace( '…', '', $more_link_html ); |
include config/theme-info.make | |
include src/make/theme-info-original.make | |
include src/make/show-help-from-comments.make | |
.PHONY: help sass build watch bump gitinit rename undo-rename dist clean b r ur gi ts | |
help: show-help-from-comments | |
## Watch and build Sass files only. Compiles all Sass to style.css, unminified. | |
sass: |
<?php | |
add_filter( 'simple_social_default_profiles', 'custom_reorder_simple_icons' ); | |
function custom_reorder_simple_icons( $icons ) { | |
// Set your new order here | |
$new_icon_order = array( | |
'bloglovin' => '', | |
'dribbble' => '', | |
'email' => '', |
To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.
// From https://news.ycombinator.com/item?id=12172180 | |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
<?php | |
/* Remove Genesis post layouts metabox if template matches 'custom-layout.php'*/ | |
add_action( 'admin_menu', 'custom_remove_custom_layouts' ); | |
function custom_remove_custom_layouts() { | |
$template_file = get_post_meta( $_GET['post'], '_wp_page_template', true ); | |
if ( $template_file == 'custom-layout.php' ) { | |
remove_action( 'admin_menu', 'genesis_add_inpost_layout_box' ); | |
} |
MailChimp's default popup scripts can break on WordPress sites that use jQuery/jQuery UI unless you include their embed code as the final elements before the closing body tag.
Including them in this way isn't always possible or easy with WordPress.
The code below is an alternative implementation of the loader that forces MailChimp's popup scripts to appear below all other scripts upon page load.
To use it, modify the baseUrl
, uuid
, and lid
attributes with the ones from the original popup script that MailChimp supplies.
<?php | |
/** | |
* Count widgets in a given sidebar, taking WPML language switching into account. | |
* | |
* Assumes widget languages are switched with the WPML String Translation or WPML Widgets plugins. | |
* | |
* @param string $id The sidebar ID. | |
* | |
* @return int The count of widgets in the sidebar. |