Skip to content

Instantly share code, notes, and snippets.

View logiblue's full-sized avatar
🙂
Sup

Karanikolas Kostantinos logiblue

🙂
Sup
View GitHub Profile
@logiblue
logiblue / functions.php
Created April 3, 2024 19:42 — forked from eristic/functions.php
Gulp file for using Gulp with Underscores theme. Place in root theme directory, saved as gulpfile.js
/*
This is taken directly from here and modified to fit our needs: https://developer.wordpress.org/themes/basics/including-css-javascript/
*/
function add_that_css_and_js() {
wp_enqueue_style( 'enqueue-that-css', get_template_directory_uri() . '/css/main.css', array(), '1.0', 'all');
wp_enqueue_script( 'enqueue-that-js', get_template_directory_uri() . '/js/min/main.min.js', array ( 'jquery' ), 1.0, true);
@logiblue
logiblue / newgistwitogo
Created September 30, 2023 18:27
New gist w/o
cide
The code part.
@logiblue
logiblue / functions.php
Created September 12, 2023 08:23
For Woocomerce Checkout- Google Analytics
//Thank You Page - CONVERSION TRACKING
function woo_conversion_tracking( $order_id ) {
$order = wc_get_order( $order_id );
$currency = $order->get_currency();
$total = $order->get_total();
$date = $order->get_date_created();
?>
@logiblue
logiblue / Google Analytics conversion tracking - Woocommerce Thank You Page
Last active September 12, 2023 08:23
Google Analytics conversion tracking - Woocommerce Thank You Page
<?php
function woo_conversion_tracking( $order_id ) {
$order = wc_get_order( $order_id );
$currency = $order->get_currency();
$total = $order->get_total();
$date = $order->get_date_created();
?>
<script type="text/javascript">
gtag('event', 'conversion', {
@logiblue
logiblue / functions.php
Created August 26, 2023 07:04
SHOW WORDPRESS USER NAME OR FIRST NAME IN MENU
Add in apperarance menus this text {{firstaname or username}}
function kk_username_fn( $menu_items ) {
global $this_user;
foreach ( $menu_items as $menu_item ) {
if ( strpos( $menu_item->title, '{{firstname}}' ) !== false ) {
// Get first name, otherwise set it to blank.
if ( $this_user->first_name ) {
$first_name = $this_user->first_name;
@logiblue
logiblue / footer.js
Created December 7, 2022 13:29
HIDE NITROPACK BADGE IN FREE VERSION
@logiblue
logiblue / scroll-to-id-before-150.js
Created November 12, 2021 08:30
[Scroll to ID] - Scroll 150px before element
// Set to scroll smooth and -50px
jQuery(document).ready(function() {
jQuery('a[href^="#"]').click(function() {
var target = jQuery(this.hash);
if (target.length == 0) target = jQuery('a[name="' + this.hash.substr(1) + '"]');
if (target.length == 0) target = jQuery('html');
jQuery('html, body').animate({ scrollTop: target.offset().top-140 }, 1);
return false;
});
});
@logiblue
logiblue / style.css
Created May 8, 2021 13:57
woodmart - Sub menu same level as the parent
.wd-dropdown-menu.wd-design-default .wd-dropdown {
top: -12px;
}
@logiblue
logiblue / mappres text
Created April 7, 2021 14:39
mappress shortcode
//mappress drag lock [leaflet]
[mappress mapid="4" dragging="disable" dragging="false"]
//mappress scroll lock [leaflet]
[mappress mapid="4" scrollwheelzoom="false" mouseWdragging="disable" dragging="false"]