how to use shortcodes inside a custom field
-
I have looked around a bunch and can’t find a solution on this.
I am using custom fields for meta tags. I want to keep things pretty simple. So its just description and keywords. But I setup a shortcode to echo the site description and I want to use the shortcode in the custom field. right now it just prints the shortcode: [bloginfo key=’description’]
<meta name="description" content="<?php if(get_post_meta($post->ID, "description", true) !='' ) echo get_post_meta($post->ID, "description", true); else bloginfo('description');?>" /> <meta name="keywords" content="<?php if(get_post_meta($post->ID, "keywords", true) != '') echo get_post_meta($post->ID, "keywords", true); else echo strtolower(get_bloginfo('name'));?>" />
Is the code I am using to print out the custom fields. Any help would be greatly appreciated.
thanks so much
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘how to use shortcodes inside a custom field’ is closed to new replies.