3v4l.org

run code in 300+ PHP versions simultaneously
<?php // ============================================================================= // FUNCTIONS.PHP // ----------------------------------------------------------------------------- // Overwrite or add your own custom functions to X in this file. // ============================================================================= // ============================================================================= // TABLE OF CONTENTS // ----------------------------------------------------------------------------- // 01. Enqueue Parent Stylesheet // 02. Additional Functions // ============================================================================= // Enqueue Parent Stylesheet // ============================================================================= add_filter( 'x_enqueue_parent_stylesheet', '__return_true' ); // Additional Functions // ============================================================================= //* custom date function displaydate(){ return date('F'); } add_shortcode('date', 'displaydate'); //add hatom data function add_suf_hatom_data($content) { $t = get_the_modified_time('F jS, Y'); $author = get_the_author(); $title = get_the_title(); if (is_home() || is_singular() || is_archive() ) { $content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>'; } return $content; } add_filter('the_content', 'add_suf_hatom_data'); // Add Google Tag Manager Code // ============================================================================= function add_google_tag_manager_code(){ ?> <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-N67NBX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-N67NBX');</script> <!-- End Google Tag Manager --> <?php } add_action( 'x_before_site_begin', 'gtm_tracking_code' ); // End Add Google Tag Manager Code // =============================================================================

preferences:
47.77 ms | 402 KiB | 5 Q