This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Script to import text files (Markdown) | |
--exported from External folder in Ulysses (Mac) | |
--to a Finder folder THE_FOLDER | |
--Imports entries from that folder with tags (Keywords) and removes tags | |
--from body of the entry | |
--Entry date is same as Creation Date of text file | |
--Required DayOne CLI tool installed on Mac | |
tell application "Finder" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Truncates a string to 275 characters to the nearest word | |
// from: preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, 201)); | |
$the_substring = preg_replace('/\s+?(\S+)?$/', '', substr( $the_string , 0, 275)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Paste the following into the Additional Parameters for <Virtual Host> field of the "Hosts" tab in MAMP (Pro) | |
# Restart MAMP | |
# Now when you type http://thishost MAMP with forward the request to https://thishost | |
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gravity Forms - scroll to the top of page on form submit | |
* | |
* Returns a value of 1px from the top. | |
*/ | |
add_filter( 'gform_confirmation_anchor_25', function() { | |
return 1; | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allow users with capability 'my_edit_settings' to edit the `my_plugin_options` settings of your Plugin | |
* | |
* This avoids giving them 'manage_options' capabilities | |
* | |
* @category WordPress | |
* @see https://codex.wordpress.org/Function_Reference/add_options_page | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WooCommerce enqueues 3 stylesheets by default. You can disable them all using: | |
* | |
* see http://docs.woothemes.com/document/disable-the-default-stylesheet/ | |
*/ | |
add_filter( 'woocommerce_enqueue_styles', '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// Replace MYLIVEDOMAIN.com with your domain. | |
// Google Analytics will now not receive hits from cloned development versions of your site on localhost etc. | |
// Also checkout `Block Yourself from Analytics` plugin for Chrome | |
// see also: http://stackoverflow.com/questions/1251922/is-there-a-way-to-stop-google-analytics-counting-development-work-as-hits | |
if (document.location.hostname.search("MYLIVEDOMAIN.com") !== -1) { | |
/* Google Analytics Code here */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the Alt text of a Featured Image | |
* | |
* And other image attributes | |
*/ | |
add_action('genesis_before_sidebar_widget_area', 'pgwp_genesis_before_sidebar_widget_area' ); | |
function pgwp_genesis_before_sidebar_widget_area () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Rename/Filter the Title of a WooCommerce Product on the Single Product Page | |
* | |
*/ | |
add_filter('the_title', 'xcsn_single_product_page_title', 10, 2); | |
function xcsn_single_product_page_title($title, $id) { | |
if( ( is_product() && in_the_loop() ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Is a WooCommerce Product Simple or Variable | |
* | |
* see http://wordpress.org/support/topic/condition-to-check-if-product-is-simple-or-variable | |
*/ | |
if( $product->is_type( 'simple' ) ){ | |
// a simple product |
NewerOlder