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
/* | |
Add a link to a Sunshine Photo Cart Main Menu | |
Add this code to your theme's functions.php | |
OR | |
Use this plugin: https://wordpress.org/plugins/my-custom-functions/ | |
*/ | |
add_filter( 'sunshine_main_menu', 'sunshine_custom_menu_item', 100 ); | |
function sunshine_custom_menu_item( $menu ) { | |
$menu[45] = array( // Change 45 to any number, it determines where in the menu it shows | |
'name' => 'PAGE_NAME_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
add_filter( 'sunshine_action_menu', 'my_sunshine_action_menu' ); | |
function my_sunshine_action_menu( $menu ) { | |
global $sunshine; | |
if ( !empty( $sunshine->cart->content ) ) | |
$cart_count = '<span class="sunshine-count sunshine-cart-count">'.$sunshine->cart->item_count.'</span>'; | |
$menu[90] = array( | |
'name' => __( 'Cart','sunshine' ), | |
'url' => sunshine_url( 'cart' ), |
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
// Add this to your theme's functions.php file | |
// Or use this plugin https://wordpress.org/plugins/my-custom-functions/ | |
add_filter( 'sunshine_main_menu', 'custom_sunshine_main_menu', 999 ); | |
function custom_sunshine_main_menu( $menu ) { | |
unset( $menu[10] ); | |
return $menu; | |
} | |
// OR, alternatively add this to Sunshine > Settings > Design > Custom CSS | |
li.sunshine-galleries { display: none; } |
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
// Add this to your theme's functions.php file | |
// Or use this plugin https://wordpress.org/plugins/my-custom-functions/ | |
add_filter( 'sunshine_image_name', 'my_sunshine_image_name', 10, 2 ); | |
function my_sunshine_image_name( $name, $image ) { | |
return basename( get_attached_file( $image->ID ) ); | |
} |
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
add_filter( 'sunshine_action_menu', 'sunshine_favorites_custom_action_menu_icon', 90 ); | |
function sunshine_favorites_custom_action_menu_icon( $menu ) { | |
if ( isset( $menu[15] ) ) { | |
$menu[15]['icon'] = 'WHATEVER'; // See http://fortawesome.github.io/Font-Awesome/cheatsheet/ | |
} | |
return $menu; | |
} |
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
// Add this to your theme's functions.php file or use a plugin like Code Snippets | |
add_filter( 'sunshine_main_menu', 'custom_sunshine_main_menu', 999 ); | |
function custom_sunshine_main_menu( $menu ) { | |
unset( $menu[100] ); | |
unset( $menu[110] ); | |
return $menu; | |
} | |
// OR, alternatively add this to Sunshine > Settings > Design > Custom CSS | |
li.sunshine--login, li.sunshine--register { display: none; } |
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 | |
// Add following to your theme's functions.php file or use something like https://wordpress.org/plugins/custom-css-js-php/ | |
add_action( 'sunshine_before_add_to_cart_form', 'sunshine_lightbox_default_qty_1' ); | |
function sunshine_lightbox_default_qty_1() { | |
?> | |
<script> | |
jQuery( document ).ready( function($){ | |
$( 'input[name="quantity"]' ).val( 1 ); | |
}); | |
</script> |
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
add_filter( 'sunshine_image_menu', 'sunshine_in_cart_icon', 90, 2 ); | |
function sunshine_in_cart_icon( $menu, $image ) { | |
global $sunshine; | |
if ( isset( $menu[10] ) ) { | |
$cart = $sunshine->cart->get_cart(); | |
if ( is_array( $cart ) ) { | |
foreach ( $cart as $item ) { | |
if ( $item['image_id'] == $image->ID ) { | |
$menu[10]['icon'] = 'check'; // See http://fortawesome.github.io/Font-Awesome/cheatsheet/ | |
} |
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
// Add this to your theme's functions.php file | |
// Or use this plugin https://wordpress.org/plugins/my-custom-functions/ | |
add_filter( 'sunshine_main_menu', 'custom_sunshine_main_menu', 999 ); | |
function custom_sunshine_main_menu( $menu ) { | |
if ( isset( SunshineFrontend::$current_gallery ) && get_post_meta( SunshineFrontend::$current_gallery->ID, 'sunshine_gallery_disable_products', true ) ) { | |
unset( $menu[40] ); | |
unset( $menu[50] ); | |
} | |
return $menu; | |
} |
OlderNewer