Hi,
I seem to be having issues with the Meta Description not showing up in pages until I save the post.
Here is what I am doing:
I create a new page, fill in my information. Save the page.
I run a script on a cron or manually, that updates the Title and Description based on custom fields inside the post.
After the script is run, I refresh the page. The title tag has updated correctly but the Description does not show in the source.
If I edit the page, I can see that the Description is saved and shows in the page SEO box, however, the description will not show inside the source of the page until I hit the update button.
Here is an example of the code in my cron:
else if ( $post->current_office == 'Mayor' OR $post->votesmart_title == 'Mayor' ) {
if ( !empty($post->votesmart_parties) ) {
if ( $post->votesmart_parties == 'Democratic' ) {
$party_is = 'Democrat';
} else if ( $post->votesmart_parties == 'Republican' ) {
$party_is = 'Republican';
}
$has_party = ' is a ' . $party_is . ' and';
} else {
$has_party = '';
}
$meta_desc = $post->post_title . $has_party . ' currently serves as the Mayor of ' . $post->votesmart_homeCity . ', Alabama.';
if ( $post->_genesis_description != $meta_desc OR empty($post->_genesis_description) ) {
$tsf->update_single_post_meta_item( '_genesis_description', $meta_desc, $post->ID );
}
$meta_title = $post->post_title . ' - Mayor of ' . $post->votesmart_homeCity . ', AL';
if ( $post->_genesis_title != $meta_title OR empty($post->_genesis_title) ) {
$tsf->update_single_post_meta_item( '_genesis_title', $meta_title, $post->ID );
}
}
-
This reply was modified 5 years, 1 month ago by
Brent Wilson.
-
This reply was modified 5 years, 1 month ago by
Brent Wilson.