Created
January 19, 2022 20:29
-
-
Save webcraftsman/175cbf4a82c0cab5252260df5ca26ad0 to your computer and use it in GitHub Desktop.
Grab social media account links from Yoast SEO in WordPress template
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 $seo_data = get_option( 'wpseo_social' );?> | |
<ol class="social-links"> | |
<li><a href="<?php echo $seo_data['facebook_site'];?>" target="_blank">Facebook</a></li> | |
<li><a href="<?php echo $seo_data['linkedin_url'];?>" target="_blank">LinkedIn</a></li> | |
<li><a href="<?php echo $seo_data['youtube_url'];?>" target="_blank">YouTube</a></li> | |
<li><a href="<?php echo $seo_data['instagram_url'];?>" target="_blank">Instagram</a></li> | |
<li><a href="https://twitter.com/<?php echo $seo_data['twitter_site'];?>" target="_blank">Twitter</a></li> | |
</ol> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment