Skip to content

Instantly share code, notes, and snippets.

View Nalci's full-sized avatar

Laura Nalci

  • Germany
View GitHub Profile
@Nalci
Nalci / detect_touch.js
Created August 12, 2024 11:54 — forked from esedic/detect_touch.js
Various JavaScript methods for detecting touch/mobile devices
// Method 1
var isTouchDevice =
(('ontouchstart' in window) ||
(navigator.MaxTouchPoints > 0) ||
(navigator.msMaxTouchPoints > 0));
if(!isTouchDevice){
console.log('is not touch');
}else{
console.log('is touch');
}
@Nalci
Nalci / functions.php
Created May 27, 2024 22:29 — forked from webtoffee-git/functions.php
Alter address format to suit European standards in WooCommerce PDF Invoice,Packing Slip,Delivery Note plugin
<?php //do not copy this line
add_filter('wf_pklist_alter_shipping_address','wf_pklist_alter_address_fn',10,3);
add_filter('wf_pklist_alter_billing_address','wf_pklist_alter_address_fn',10,3);
add_filter('wf_pklist_alter_shipping_from_address','wf_pklist_alter_address_fn',10,3);
function wf_pklist_alter_address_fn($address, $template_type, $order)
{
$arr=array($address['postcode'], $address['city']);
$address['city']=implode( ", ",$arr);
unset($address['postcode']);
@Nalci
Nalci / wpa-clean-header.php
Created May 9, 2024 14:14 — forked from Auke1810/wpa-clean-header.php
create a clean wordpress header and remove unnecessary clutter.
<?php
/*
Plugin Name: wordpress assist clean header
Plugin URI: http://www.wordpressassist.nl/
Description: Remove shortlink hook
Version: 1.0
Author: AukeJomm
Author URI: http://www.aukejongbloed.nl
*/
@Nalci
Nalci / PHP Mailer Configuration for WordPress.php
Created May 9, 2024 13:30 — forked from nextab/PHP Mailer Configuration for WordPress.php
Just define the globals in wp-config.php and add the code snippet in your functions.php to send e-mails via SMTP instead of the regular php mailer.
Folgenden Code unter übliche wp-config-.php-Befehle einfügen: (Auf All-Inkl angewandt - andere Host-Daten müssten dementsprechend angepasst werden...)
define( 'SMTP_USER', 'm05f2ew1' ); // Postfach-Benutzer
define( 'SMTP_PASS', 't3stpwd' ); // Postfach-Passwort
define( 'SMTP_HOST', 'w01c1234.kasserver.com' ); // Postein- und Ausgangsserver
define( 'SMTP_FROM', 'mail@example.com' ); // Gewünschte E-Mail-Adresse zum Versenden
define( 'SMTP_NAME', 'Example Website' ); // Webseiten-Name
define( 'SMTP_PORT', '465' ); // SMTP-Port - häufig 465 oder 587 (auch 25, aber unsicher)
define( 'SMTP_SECURE', 'ssl' ); // Verschlüsselungstyp (auch tls möglich)
define( 'SMTP_AUTH', true ); // SMTP-Authentifikation
@Nalci
Nalci / .htaccess
Created March 28, 2024 16:24 — forked from seoagentur-hamburg/.htaccess
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################