This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
# Function to lowercase everything within the 'lazy-src' attribute in an HTML file | |
def lowercase_lazy_src(file_path): | |
with open(file_path, 'r', encoding='utf-8') as file: | |
content = file.read() | |
# Use regular expression to find all 'lazy-src' attributes and lowercase their values | |
modified_content = re.sub(r'lazy-src="([^"]+)"', lambda match: f'lazy-src="{match.group(1).lower()}"', content, flags=re.IGNORECASE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="flexy flexy-pad equal-height is-multiline pv100"> | |
<div class="flexy-item is-4 is-6-widescreen animate fadeIn no-delay"> | |
<a class="card no-pad" href="/"> | |
<img lazy-src="/assets/img/blog/gum-line-cavities.jpg" alt="<?php AltTag() ?>"> | |
<div class="card-content"> | |
<h2 class="title-sm uppercase mb65 animate fadeIn no-delay">Replace</h2> | |
<p class="animate fadeIn white small-subhead no-delay">Replace</p> | |
<p class="animate fadeIn no-delay">Replace</p> | |
<span class="button animate fadeIn no-delay mb50">Read More</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Do not include opening <?php tag | |
//* Load custom style sheet | |
add_action( 'wp_enqueue_scripts', 'load_styles' ); | |
function load_styles() { | |
wp_enqueue_style( | |
'custom', | |
get_stylesheet_directory_uri() . '/css/custom.css', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
// $ Works! You can test it with next line if you like | |
console.log("I'm alive!"); | |
})( jQuery ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Only Code Below This Line | |
//_________________________________________ | |
//* Customize the entire footer | |
remove_action( 'genesis_footer', 'genesis_do_footer' ); | |
add_action( 'genesis_footer', 'custom_footer' ); | |
function custom_footer() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Drop Slick Slider files inside of js folder and add the following to your functions.php | |
//Slick Slider JS | |
add_action('wp_enqueue_scripts', 'load_slick', 5); | |
function load_slick(){ | |
// Slick Slider JS | |
wp_enqueue_script( | |
'slick', | |
get_stylesheet_directory_uri() . '/js/slick/slick.js', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Customize Footer | |
remove_action( 'genesis_footer', 'genesis_do_footer' ); | |
add_action( 'genesis_footer', 'custom_footer' ); | |
function custom_footer() { | |
?> | |
<p>© Copyright 2018 <a href="#">My Domain</a> · All Rights Reserved · Powered by <a href="http://wordpress.org/">WordPress</a> · <a href="http://mydomain.com/wp-admin">Aline Inc.</a></p> | |
<?php | |
} | |
//* Remove the edit link | |
add_filter ( 'genesis_edit_post_link' , '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
folder_path = os.getcwd() | |
for filename in os.listdir(folder_path): | |
if filename.endswith(".png.jpg"): | |
new_filename = filename.replace(".png", "") | |
os.rename(os.path.join(folder_path, filename), os.path.join(folder_path, new_filename)) | |
print("Renamed '{}' to '{}'".format(filename, new_filename)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const logo = document.querySelector('.navbar__logo'); | |
const menuButton = document.querySelector('.menu-button'); | |
let isScrolled = false; | |
let isMenuOpen = false; | |
function updateLogo() { | |
if (isMenuOpen || isScrolled) { | |
logo.src = '/assets/img/logo.svg'; | |
} else { | |
logo.src = '/assets/img/logo-white.svg'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="https://picsum.photos/seed/fun/2000/1000?grayscale" alt="Image 1"> | |
<img src="https://picsum.photos/seed/art/2000/1000" alt="Image 2"> | |
<!-- https://picsum.photos/ --> |