"; } if ( ! empty( $yandex ) ) { $array[] = ""; } if ( ! empty( $bing ) ) { $array[] = ""; } // Website Verification Services if ( ! empty( $pinterest ) ) { $array[] = ""; } if ( ! empty( $google_author ) ) { $array[] = ""; } if ( ! empty( $facebook ) ) { $array[] = ""; } if ( ! empty( $twitter ) ) { $array[] = ""; $array[] = ""; } if ( ! empty( $alexa ) ) { $array[] = ""; } if ( ! empty( $norton ) ) { $array[] = ""; } if ( ! empty( $wot ) ) { $array[] = ""; } if ( ! empty( $specificfeeds ) ) { $array[] = ""; } if ( ! empty( $custom_meta ) ) { $array[] = $custom_meta; } // Custom meta tags for specific pages if ( is_front_page() && is_home() ) { // Default Home Page if ( ! empty( $home_description ) ) { $array[] = ""; } if ( ! empty( $home_keywords ) ) { $array[] = ""; } } elseif ( is_front_page() ) { // Static Home Page if ( ! empty( $home_description ) ) { $array[] = ""; } if ( ! empty( $home_keywords ) ) { $array[] = ""; } } elseif ( is_home() ) { // Blog Page if ( ! empty( $home_description ) ) { $array[] = ""; } if ( ! empty( $home_keywords ) ) { $array[] = ""; } } // Custom meta tags for the entire website if ( ! empty( $author ) ) { $array[] = ""; } if ( ! empty( $designer ) ) { $array[] = ""; } if ( ! empty( $contact ) ) { $array[] = ""; } if ( ! empty( $copyright ) ) { $array[] = ""; } if ( ! empty( $keywords ) ) { $array[] = ""; } // WooCommerce & Google Shopping (Merchant Center) if ( class_exists( 'WooCommerce' ) ) { if ( is_product() ) { // Get product data $name = str_replace( "'", "’", strip_tags( get_the_title() ) ); $description = str_replace( "'", "’", strip_tags( get_the_excerpt() ) ); $image = simplexml_load_string( get_the_post_thumbnail() ); if ( ! empty( $image ) ) { $imagesrc = $image->attributes()->src; } else { $imagesrc = ""; } $price = get_post_meta( get_the_ID(), '_price', true ); $currency = get_woocommerce_currency(); // Generate output code with product data $google_shopping = "
"; $array[] = $google_shopping; } } // Add comment if ( count( $array ) > 0 ) { array_unshift( $array, "" ); array_push( $array, "" ); } // Return the content of array return $array; } /** * Process the custom meta tags */ function spacexchimp_p004_exec() { echo PHP_EOL, implode(PHP_EOL, spacexchimp_p004_prepare()), PHP_EOL, PHP_EOL; } /** * Inject the custom meta tags into the website's frontend */ add_action( 'wp_head', 'spacexchimp_p004_exec', 0 ); /** * Preview the custom meta tags */ function spacexchimp_p004_preview() { $array = spacexchimp_p004_prepare(); if ( ! empty( $array ) ) { if ( is_array( $array ) ) { if ( count( $array ) > 0 ) { array_shift( $array ); } if ( count( $array ) > 0 ) { array_pop( $array ); } if ( count( $array ) > 0 ) { $array = implode( PHP_EOL, $array ); } } } // Return the string echo $array; }