Skip to content

Instantly share code, notes, and snippets.

View stoffl6781's full-sized avatar

Christoph Purin - Stoffl/OE9CPV stoffl6781

View GitHub Profile
{% component 'gist' %}
add_filter( 'get_product_search_form' , 'me_custom_product_searchform' );
/**
* Filter WooCommerce Search Field
*
*/
function me_custom_product_searchform( $form ) {
$form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '">
<div>
@stoffl6781
stoffl6781 / biorhytm.py
Created October 21, 2020 11:17
Python Biorhythmus
from datetime import date
import matplotlib.dates
from pylab import *
from numpy import array,sin,pi
date_entry = input('Dein Geburtsdatum DD.MM.YYYY:')
day, month, year = map(int, date_entry.split('.'))
dob = datetime.date(year, month, day)
UPDATE `wp_posts` SET guid = REPLACE(guid, 'oldsiteurl', 'newsiteurl') WHERE guid LIKE 'oldsiteurl%';
UPDATE `wp_postmeta` SET meta_value = REPLACE(meta_value, 'oldsiteurl', 'newsiteurl') WHERE meta_value LIKE 'oldsiteurl%';
UPDATE `wp_options` SET option_value = REPLACE(option_value, 'oldsiteurl', 'newsiteurl') WHERE option_value LIKE 'oldsiteurl%';
@stoffl6781
stoffl6781 / gist:c3d897817c625a20a72909ad6778151d
Last active April 20, 2021 19:59
Random Image Shortcode - TAG list
add_action( 'init', 'wpd_attachment_taxonomy' );
function random_image($atts) {
$opn = shortcode_atts( array(
'tag' => 'tag',
'description' => 'description',
'caption' => 'caption',
'size' => 'size',
), $atts );
@stoffl6781
stoffl6781 / toggle-button.css
Created June 22, 2021 19:32 — forked from kidino/toggle-button.css
Creating a Toggle Button with Elementor Pro - The CSS & Javascript Code
/*
This is the CSS code for creating your own Toggle Button Widget using
Elementor Pro.
You still need the Javascript code for this to work.
The Youtube tutorial is here. Make sure you watch this to understand
how this works.
https://youtu.be/ZhBGPIU1bq0
function custom_um_profile_query_make_posts( $args = array() ) {
// Change the post type to our liking.
$args['post_type'] = 'jobs';
return $args;
}
// [um_user user_id="123" meta_key="cover_photo" ]
add_filter( 'um_profile_query_make_posts', 'custom_um_profile_query_make_posts', 12, 1 );
add_filter("um_user_shortcode_filter__cover_photo","um_user_shortcode_filter__cover_photo", 10, 3);
function um_user_shortcode_filter__cover_photo( $meta_value, $raw_meta_value, $user_id ){
return UM()->uploader()->get_upload_user_base_url( $user_id )."/".$meta_value;
}
add_filter("um_user_shortcode_filter__profile_photo","um_user_shortcode_filter__profile_photo", 10, 3);
@stoffl6781
stoffl6781 / gist:d28ed53e2e350e7b89e78c6e2f2471de
Last active October 18, 2021 13:10
Elementor keyframes for Animation
@keyframes bounce{20%,53%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1);transform:translate3d(0,0,0)}40%,43%{animation-timing-function:cubic-bezier(.755,.050,.855,.060);transform:translate3d(0,-30px,0)}70%{animation-timing-function:cubic-bezier(.755,.050,.855,.060);transform:translate3d(0,-15px,0)}90%{transform:translate3d(0,-4px,0)}}.bounce{animation-name:bounce;transform-origin:center bottom}
@keyframes flash{50%,from,to{opacity:1}25%,75%{opacity:0}}.flash{animation-name:flash}
@keyframes pulse{from,to{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}}.pulse{animation-name:pulse}
@keyframes rubberBand{from,to{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}}.rubberBand{animation-name:rubberBand}
@keyframes shake{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-10px,0,0)}20%,40%,60%,80%{transform:t
@stoffl6781
stoffl6781 / custom-animation-Elementor.php
Created October 18, 2021 13:14
Custom Animation for Elementor - Register to "animation dropdown" your own animation settings.
/*
* add to function.php
*/
function my_entrance_animations() {
return array(
'Custom Slide Animations' => [
'customSlideDown' => 'Custom Slide Down', // 'customSlidedown' = CSS class for style.css
'customSlideleft' => 'Custom Slide Left',
'customSlideleft2' => 'Custom Slide small Left',