Skip to content

Instantly share code, notes, and snippets.

@peltopiri
peltopiri / wp.sh
Created February 16, 2017 12:31 — forked from phlbnks/wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
@peltopiri
peltopiri / functions.php
Last active April 11, 2019 12:28
WooCommerce hide/exclude categories from category widget
<?php
/* Exclude WC Product Categories */
function peltopiri_exclude_wc_widget_categories($cat_args) {
$cat_args['exclude'] = array('16');
return $cat_args;
}
add_filter('woocommerce_product_categories_widget_dropdown_args', 'peltopiri_exclude_wc_widget_categories');
add_filter('woocommerce_product_categories_widget_args', 'peltopiri_exclude_wc_widget_categories');
@peltopiri
peltopiri / archive-product.php
Created March 27, 2019 12:38
WooCommerce - Nested Category/Subcategory Layout, FIXED: show subcategory content
<?php
/**
* The Template for displaying product archives, including the main shop page which is a post type archive
*
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
@peltopiri
peltopiri / functions.php
Created May 26, 2023 07:01
Kadence theme, set scroll to anchor offset when using fixed header element
/***********************************************************
* Scroll to anchor offset when using custom fixed header
************************************************************/
add_filter('kadence_scroll_to_id_additional_offset', function() {
return 100;
});