Skip to content

Instantly share code, notes, and snippets.

View BoyetDgte's full-sized avatar

IRC on VPS BoyetDgte

View GitHub Profile
BoyetDgte / Custom WooCommerce login
Last active August 9, 2019 12:30
Custom WooCommerce login and dashboard button
add_filter( 'wp_nav_menu_items', 'custom_login_dashboard', 10, 2 );
function custom_login_dashboard( $items, $args ) {
if (is_user_logged_in() && $args->primary-menu == 'primary') { //change your theme registered menu name to suit - currently for DIVI theme
$items .= '<li><a class="mydashboard" href="'. get_permalink( wc_get_page_id( 'myaccount' ) ) .'">My Dashboard</a></li>' . '<style> #top-header { background: #7a0101!important;} #main-header, #main-footer, #footer-bottom { background: black!important;}</style>';
//the style is changing the theme's color once you are logged in
elseif (!is_user_logged_in() && $args->primary-menu == 'primary') {//change your theme registered menu name to suit
$items .= '<li><a class="mydashboard" href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '">Log In</a></li>';
TimBHowe / functions.php
Created March 8, 2016 17:54
Forcibly remove the tax line item and calculation from the cart. (suggest just using the GEO setting in WooCommerce)
// Remove the Tax Line item from the cart.
function wc_remove_cart_tax_totals( $tax_totals, $instance ) {
if( is_cart() ) {
$tax_totals = array();
return $tax_totals;
scottious / gist:0d99ea77daa041b28929
Created November 10, 2014 00:39
__git_ps1 command not found issue.

I've been having an issue with the following error appear in the prompt after upgrading to Yosemite. The solution was to source the git bash completion and prompt files from a local copy.

    curl -o ~/.git-completion.bash
    curl -o ~/

Then in:

    vi ~/bash_profile