Skip to content

Instantly share code, notes, and snippets.

View istvankrucsanyica's full-sized avatar

Istvan Krucsanyica istvankrucsanyica

View GitHub Profile
@istvankrucsanyica
istvankrucsanyica / index.html
Created October 8, 2018 09:15 — forked from jcanfield/index.html
DublinCore, Facebook Meta Tag and Geolocation Meta Tags (HTML5)
<!DOCTYPE html>
<html lang="en">
<head>
<title>Lonely Women Cooks For Nobody</title>
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
<link rel="schema.DCTERMS" href="http://purl.org/dc/terms/">
<meta name="DC.title" content="Lonely Women Cooks For Nobody<">
<meta name="DC.creator" content="William Clinton (http://www.man-has-his-needs.com/">
<meta name="DC.subject" content="Politics">
@istvankrucsanyica
istvankrucsanyica / kia_add_script_to_footer.php
Created February 6, 2018 08:31 — forked from helgatheviking/kia_add_script_to_footer.php
Add plus and minus buttons to WooCommerce quantity inputs
@istvankrucsanyica
istvankrucsanyica / wc-products-filter-custom-tax.php
Created January 4, 2018 13:00 — forked from alexphelps/wc-products-filter-custom-tax.php
WooCommerce Products Filter Custom Taxonomy
/**
* Filter team products from main shop only on frontend on shop, category, and tag archives
*/
function exclude_team_products( $query ) {
$archive_query = $query->is_post_type_archive('product') && $query->is_main_query();
$cat_tag_query = $query->is_tax( array('product_cat', 'product_tag') ) && $query->is_main_query();
if ( !is_admin() && $archive_query || !is_admin() && $cat_tag_query ) {
$taxquery = array(
array(
'taxonomy' => 'product_team',
@istvankrucsanyica
istvankrucsanyica / woocommerce-my-account.php
Created January 3, 2018 10:11 — forked from pietromalerba/woocommerce-my-account.php
Add custom fields to Woocommerce My Account
// Add VAT and SSN fields in billing address display
add_filter( 'woocommerce_order_formatted_billing_address', 'custom_add_vat_ssn_formatted_billing_address', 10, 2 );
function custom_add_vat_ssn_formatted_billing_address( $fields, $order ) {
$fields['vat'] = $order->billing_vat;
$fields['ssn'] = $order->billing_ssn;
return $fields;
}
add_filter( 'woocommerce_my_account_my_address_formatted_address', 'custom_my_account_my_address_formatted_address', 10, 3 );
@istvankrucsanyica
istvankrucsanyica / functions.php
Created January 3, 2018 10:10 — forked from Miq3l/functions.php
Adding VAT to WooCommerce
/***************************** FRONTEND ****************************************/
/**************************
Filter to add a VAT field to:
- My Account - Edit Form -- Billing fields
- Checkout - Edit Form - Billing Fields
This function is also reordering the form fields
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2017.21.01
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */
@istvankrucsanyica
istvankrucsanyica / Remove SEO-plugin HTML comments.php
Created February 20, 2017 09:26 — forked from llgruff/Remove SEO-plugin HTML comments.php
Remove [All in One SEO Pack] or [Yoast SEO] HTML Comments in WordPress (for functions.php)
<?php
/**
* Remove [All in One SEO Pack] HTML Comments
* @link //gist.github.com/llgruff/a7ab776167aa0ed307ec445df54e5fdb
*/
if (defined('AIOSEOP_VERSION')) {
add_action('get_header', function() {
ob_start(
function($o) {
return preg_replace('/\n?<.*?One SEO Pack.*?>/mi','',$o);
if(!function_exists('before_header_partnerki_runeta') && !function_exists('after_header_partnerki_runeta') && !function_exists('change_aioseop_tag_partnerki_runeta')){
add_action('template_redirect', 'before_header_partnerki_runeta', 0);
add_action('wp_head', 'after_header_partnerki_runeta', 900);
function before_header_partnerki_runeta (){
ob_start('change_aioseop_tag_partnerki_runeta');
}
function change_aioseop_tag_partnerki_runeta($head) {
$head_description = preg_replace("~(<meta name=\"description\" content=\".*\" />)\n~Uis", '$1', $head);
if($head_description !== NULL) $head = $head_description;
$head_keywords = preg_replace("~(<meta name=\"keywords\" content=\".*\" />)\n~Uis", '$1', $head);
<?php
App::after(function($request, $response)
{
/**
* HTML Minification
* https://gist.github.com/zmsaunders/5619519
* https://gist.github.com/garagesocial/6059962
*/
if (Config::get('project.minify.html', false) !== false)
// Writing JS for everything is great and all, but I don't want to see JS
// inline in my Jade templates. Thankfully, there are ways of abstrating it
// into mixins!
// Want some Rails-like helpers?
mixin link_to(name, href)
- href = href || "#"
a(href="#{href}")= name
// How about a single editing point for a class name?