Last active
September 23, 2020 13:02
-
-
Save sukhikh18/71b72230c0a2a0482f2199cc0cb2700a to your computer and use it in GitHub Desktop.
#Raw
This file contains hidden or 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 | |
if( is_singular( array('product') ) ) { | |
add_filter( 'wpseo_title', function($old) { | |
$price = get_post_meta( get_the_ID(), '_regular_price', true); | |
return $price; | |
}, 100 ); | |
add_filter( 'wpseo_metadesc', function($old) { | |
$price = get_post_meta( get_the_ID(), '_regular_price', true); | |
return $price; | |
}, 100 ); | |
add_filter( 'wpseo_metakey', function($old) { | |
$price = get_post_meta( get_the_ID(), '_regular_price', true); | |
return $price; | |
}, 100 ); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment