Archives: Snippets
Google Tag
[wpb-random-posts]
$args = array( ‘post_type’ => ‘post’, ‘orderby’ => ‘rand’, ‘posts_per_page’ => 5, );Continue reading
Open All Internal and External Link in New Tab in WordPress
function open_internal_links_in_new_tab() { echo ‘ ‘; } add_action(‘wp_footer’, ‘open_internal_links_in_new_tab’);Continue reading
Pixel Bluue Sleep
Add dynamic copyright year (center) to footer
// This will output “Copyright © 2024” (or the current year) in the footer automatically. $copyright = “Copyright © ” ; $current_year = date( ‘Y’ ) ; $copyright_year = $copyright . $current_year ; // Add CSS classes for styling. For…Continue reading
Add dynamic copyright year
// This will output “Copyright © 2024” or the current year automatically. $copyright = “Copyright © ” ; $current_year = date( ‘Y’ ) ; $copyright_year = $copyright . $current_year ; echo $copyright_year; // For centered text, replace line 9 with…Continue reading
Replace [year] with the current year
// This will replace “[year]” with the current year automatically. $this_year = “[year]”; echo str_replace(“[year]”, date( ‘Y’ ), $this_year);Continue reading
traffichaus PIX
Untitled Snippet
// Get the butterflies container const butterfliesContainer = document.querySelector(‘.butterflies’); // Create a function to generate a butterfly function createButterfly() { const butterfly = document.createElement(‘div’); butterfly.className = ‘butterfly’; butterfliesContainer.appendChild(butterfly); return butterfly; } // Create multiple butterflies for (let i = 0;…Continue reading