const element = document.querySelector('.footer');
const offset = getElementOffset(element);
window.scrollTo(0, offset);
<?php
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
?>
<?php
// Automatically Delete Woocommerce Images After Deleting a Product
add_action( 'before_delete_post', 'delete_product_images', 10, 1 );
function delete_product_images( $post_id )
{
$product = wc_get_product( $post_id );
if ( !$product ) {
return;
}
$featured_image_id = $product->get_image_id();
$image_galleries_id = $product->get_gallery_image_ids();
if( !empty( $featured_image_id ) ) {
wp_delete_post( $featured_image_id );
}
if( !empty( $image_galleries_id ) ) {
foreach( $image_galleries_id as $single_image_id ) {
wp_delete_post( $single_image_id );
}
}
}
?>
/* Elemento base */
::-webkit-scrollbar {
width: 15px;
}
/* Carril */
::-webkit-scrollbar-track {
background: #000;
}
/* Manejador */
::-webkit-scrollbar-thumb {
background: #f9a50b;
border-radius: 4px;
border: 2px solid #ccc;
}
/* Manejador hover */
::-webkit-scrollbar-thumb:hover {
background: #fe6c03;
border: 2px solid #309197;
}
document.addEventListener('DOMContentLoaded', function(e) {
document.addEventListener('scroll', function(e) {
let documentHeight = document.body.scrollHeight;
let currentScroll = window.scrollY + window.innerHeight;
// When the user is [modifier]px from the bottom, fire the event.
let modifier = 200;
if(currentScroll + modifier > documentHeight) {
console.log('You are at the bottom!')
}
})
})