Skip to content

Instantly share code, notes, and snippets.

View sunshinephotocart's full-sized avatar

Sunshine Photo Cart sunshinephotocart

View GitHub Profile
@sunshinephotocart
sunshinephotocart / gist:74a54b2d20bc9279e586
Last active January 26, 2016 17:45
Add cart/checkout to action menu (gallery and image pages)
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' ),
@sunshinephotocart
sunshinephotocart / gist:012b9ddc454b0fbed8ca
Last active January 9, 2018 18:10
Add link to Sunshine Main Menu
/*
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',