This file contains hidden or 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
// | |
// Add the menu item description to the visible title. | |
// | |
add_filter( 'nav_menu_item_title', 'nav_add_desc', 10, 4); | |
function nav_add_desc( $title, $menu_item, $args, $depth ) { | |
$retHtml = ''; | |
$desc = $menu_item->description; |
This file contains hidden or 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
When you visit [bloginfo show="name"] details of your visit may be logged in the following ways: | |
<ul> | |
<li>Standard web server logging</li> | |
<li>Google Analytics. Google Analytics uses cookies to accumulate analytics data. This analytics data is used for the purpose of determining the volume and types of usage of the [bloginfo show="name"] web site. Details of Google’s usage of this data may be found at <a href="https://policies.google.com/technologies/partner-sites" target="_blank" rel="noopener noreferrer">https://policies.google.com/technologies/partner-sites</a></li> | |
<li>Error logging generated by components of the [bloginfo show="url"] web site, which may occur from time-to-time.</li> | |
</ul> | |
Information logged may include, but may not be limited to: |
This file contains hidden or 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
// | |
// Make Gravity Forms radio buttons look like normal buttons. Add this SCSS (or convert to CSS) to your WP theme, | |
// then add the gf_radio_slides class to your radio buttons in the | |
// Gravity Forms > Editor > Radio Buttons > Appearance > Custom CSS Class | |
// | |
// | |
.gf_radio_slides { | |
.gfield_radio { | |
.gchoice { | |
display: inline-block !important; |
This file contains hidden or 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
# | |
# Using NVM with multiple versions of NodeJS, use 'prestart' to change the version of NodeJS | |
# | |
# https://chamikakasun.medium.com/how-to-manage-multiple-node-versions-in-macos-2021-guide-5065f32cb63b | |
# | |
# https://itnext.io/nvm-the-easiest-way-to-switch-node-js-environments-on-your-machine-in-a-flash-17babb7d5f1b | |
# | |
# https://stackoverflow.com/questions/34301122/is-there-a-way-to-run-nvm-use-automatically-in-a-prestart-npm-script | |
# | |
# For example, the'prestart' command was added to package.js to set the correct version of NodeJS for this FoundationPress build |
This file contains hidden or 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
add_filter( 'register', 'bl_register_link'); | |
function bl_register_link() { | |
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'New Customers - Register Now' ) ); | |
return $registration_url; | |
} |
This file contains hidden or 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
// | |
// Disable the Woo lightbox | |
// | |
add_action( 'after_setup_theme', 'bl_disable_wc_lightbox', 100 ); | |
function bl_disable_wc_lightbox() { | |
remove_theme_support( 'wc-product-gallery-lightbox' ); | |
remove_theme_support( 'wc-product-gallery-zoom' ); | |
} | |
This file contains hidden or 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
// | |
// Shortcode to add a custom Add-To-Cart and Checkout button | |
// | |
// Button displays icon, price and product name | |
// | |
function bl_add_to_cart_button( $atts ) { | |
$params = shortcode_atts( array( | |
'id' => null, | |
'text' => '{product_name}', | |
'show_icon' => 1, |
This file contains hidden or 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
// | |
// Hide chargable shipping methods if free shipping is valid | |
// Thanks to https://flexibleshipping.com/woocommerce-free-shipping-over-amount/ | |
// | |
function bl_hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); | |
foreach ( $rates as $rate_id => $rate ) { | |
if ( 'free_shipping' === $rate->method_id ) { | |
$free[ $rate_id ] = $rate; |
This file contains hidden or 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
// | |
// Hook the SimpleLinks plugin output. | |
// Puts the list into a table to match the site, which includes the post_date and a the 'Source' custom field | |
// | |
// Example shortcode call: | |
// | |
// [simple-links category="In the Press" fields="pub_date,source" orderby="date" order="DESC" count=5] | |
// | |
add_filter('simple_links__output', 'bl_link_out',10,3); |
This file contains hidden or 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
// apply categories to attachments | |
function add_media_categories() { | |
register_taxonomy_for_object_type( 'category', 'attachment' | |
); | |
} | |
add_action( 'init' , 'add_media_categories' ); |