Skip to content

Instantly share code, notes, and snippets.

View matthijs166's full-sized avatar

Matthijs Knigge matthijs166

View GitHub Profile
//add option page
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Theme General Settings',
'menu_title' => 'Theme Settings',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_posts',
'redirect' => false
));
@matthijs166
matthijs166 / php year
Created September 22, 2017 20:52
echo the php year
<?php echo date("Y"); ?>
@media screen and (min-width: 780px) {
//css here
}
@media screen and (max-width: 780px) {
//css here
}
<meta name="pinterest" content="nopin" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--
// ________________________________________________________________
//
// _____ _ _ _ ____ _ _
// / ____| | | (_) | _ \ | | |
// | (___ | |_ _ _ __| |_ ___ | |_) | __ _ ___ __ _| | |_
// \___ \| __| | | |/ _` | |/ _ \ | _ < / _` / __|/ _` | | __|
// ____) | |_| |_| | (_| | | (_) | | |_) | (_| \__ \ (_| | | |_
// |_____/ \__|\__,_|\__,_|_|\___/ |____/ \__,_|___/\__,_|_|\__|
//
@matthijs166
matthijs166 / declare support
Created October 16, 2017 13:28
Woocomecre decleare support
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
add_theme_support( 'woocommerce' );
}
@matthijs166
matthijs166 / woocomerce widget hide filter
Last active October 16, 2017 15:41
remove all the widgets in de woocomerce plugin
//remove woocomerce widgets
add_filter( 'woocommerce_product_categories_widget_args', 'woo_product_cat_widget_args' );
function woo_product_cat_widget_args( $cat_args ) {
unregister_widget('WC_Widget_Cart');
unregister_widget('WC_Widget_Layered_Nav');
unregister_widget('WC_Widget_Recently_Viewed');
unregister_widget('WC_Widget_Top_Rated_Products');
unregister_widget('WC_Widget_Layered_Nav_Filters');
unregister_widget('WC_Widget_Price_Filter');
unregister_widget('WC_Widget_Product_Categories');
@matthijs166
matthijs166 / remove content editor
Created October 19, 2017 14:06
remove content editor in post catogroies
<?php
function remove_product_editor() {
remove_post_type_support( 'product', 'editor' );
}
add_action( 'init', 'remove_product_editor' );
@matthijs166
matthijs166 / remove content editor
Created October 19, 2017 14:06
remove content editor in post catogroies
<?php
function remove_product_editor() {
remove_post_type_support( 'product', 'editor' );
}
add_action( 'init', 'remove_product_editor' );