Last active
January 8, 2021 20:25
-
-
Save lukeawyatt/70d02e86707b2a39b3968702ebbee7d4 to your computer and use it in GitHub Desktop.
Application: WordPress
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 /** INCLUDE IN FUNCTIONS.PHP **/ | |
function set_metadata() { | |
global $post; | |
$title = get_post_meta($post->ID, MetaTitle, true); | |
$keywords = get_post_meta($post->ID, MetaKeywords, true); | |
$description = get_post_meta($post->ID, MetaDescription, true); | |
if (!is_home() || !is_front_page()) { | |
if (!empty($title)) { | |
echo '<meta name="title" content="' . $title . '" />'; | |
} | |
if (!empty($keywords)) { | |
echo '<meta name="keywords" content="' . $keywords . '" />'; | |
} | |
if (!empty($description)) { | |
echo '<meta name="description" content="' . $description . '" />'; | |
} | |
} | |
echo $metatag; | |
} | |
add_action('wp_head', 'set_metadata'); | |
?> |
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
UPDATE `wp_posts` | |
SET `post_content` = REPLACE(`post_content`, "http://oldurl.com", "https://newurl.com"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment