Skip to content

Instantly share code, notes, and snippets.

View julian-stark's full-sized avatar

Julian Stark julian-stark

View GitHub Profile
@julian-stark
julian-stark / remove-eicons-from-elementor.php
Last active April 14, 2023 09:05
This is a nicer method to replace Eicons from Elementor. Don't remove it in the backend - Elementor is based on it ;)
<?php
// Deactivate Eicons in Elementor
add_action( 'wp_enqueue_scripts', 'js_remove_default_stylesheet', 20 );
function js_remove_default_stylesheet() {
// Don't remove it in the backend
if ( is_admin() || current_user_can( 'manage_options' ) ) {
return;
}
@julian-stark
julian-stark / login_screen.php
Created December 17, 2022 09:46
WordPress Custom Login Screen
/*
* LOGIN SCREEN
*/
// Logo
function sd_custom_login_logo() { ?>
<style type="text/css">
body.login div#login h1 a {
background-image: url(<?php echo get_bloginfo( 'template_directory' ) ?>/img/logo-login.png);
padding-bottom: 10px;
@julian-stark
julian-stark / ribbon.css
Last active November 30, 2022 09:05
Simple CSS only corner ribbon
/*
Example:
https://share.cleanshot.com/yZOIpu
HTML:
<div class="box">
<div class="ribbon"><span>News</span></div>
</div>
@julian-stark
julian-stark / enfold-footer-link.txt
Last active October 10, 2022 07:05
Enfold - Footer link on right side
@julian-stark
julian-stark / dompdf_in_wp.php
Last active August 15, 2022 05:08
Use DOMPDF to generate PDF on specific WordPress Post URL
<?php
use Dompdf\Dompdf;
use Dompdf\Options;
add_action('wp', 'sd_generate_pdf');
function sd_generate_pdf() {
// Only on post with id 750
if( get_the_ID() != 750 ) {
return;
@julian-stark
julian-stark / replace-eicons-with-font-awesome-in-elementor-templates.css
Created December 31, 2018 13:42
If you use Elementor Pro for the header, the Eicons font is used for the hamburger icon. This CSS code replaces it with Font Awesome icons.
/*
* Replace Eicons with FontAwesome
*/
.eicon {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@julian-stark
julian-stark / style.css
Last active December 11, 2020 07:24
Anchor link scrolls too deep?
/**
* If #anchor link scrolls to deep -> e.g. heading is hidden by sticky header
**/
h2 {
/* margin: 20px 0; Let's imagine h2 has margin-top of 20px */
padding-top: 100px; /* new padding-top = height element should be moved down in scroll (e.g. sticky header height) */
margin-top: -80px; /* new margin top = old margin-top - new padding-top */
}
@julian-stark
julian-stark / vba_json_to_exel.vba
Created September 8, 2020 12:29
VBA: JSON API -> Excel
Sub js_json_api_example()
Dim req As MSXML2.ServerXMLHTTP60
Dim apiURL, ret As String
Set req = New MSXML2.ServerXMLHTTP60
' Example API: Openweathermap.org
apiURL = "https://samples.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=439d4b804bc8187953eb36d2a8c26a02"
@julian-stark
julian-stark / echo_vs_return_in_shortcodes.php
Created July 17, 2020 11:36
Wordpress shortcode function: echo vs return
<?php
// Don't use echo in the shortcodes. If you have to, use ob_start() / return ob_get_clean()
add_shortcode('test', 'my_test_func');
function my_test_func( $args ) {
ob_start();
?>
your content / html / etc
<?php
@julian-stark
julian-stark / style.css
Last active July 2, 2020 09:53
Extras for Elementor - Button Group - Horizontal Scroll
/* add class .horizontal-scroll to element */
@media (max-width:1024px) {
.horizontal-scroll ul.ee-button-group {
display:flex;
flex-wrap:nowrap;
overflow-x:auto;
justify-content:flex-start;
}
.horizontal-scroll ul.ee-button-group li {