Support » Fixing WordPress » c2c_get_custom plugin meta fields question in head
9 years, 9 months ago
I’m trying to use the c2c get_custom() plugin to add keyword and description meta day on a per page basis to a site.
I’m using this code:
<meta name="description" content="<?php echo c2c_get_custom('mdesc'); ?>" />
<meta name="keywords" content="<?php echo c2c_get_custom('mkey'); ?>" />
and I’ve tried putting the html construct into the params, like:
<?php echo c2c_get_custom('mdesc', '<meta name="description" content="', '" />', '', ''); ?>
<?php echo c2c_get_custom('mkey', '<meta name="keywords" content="', '" />', '', ''); ?>
but neither work. All I get is the meta tag, attribute and =”” /> so empty content. I did enter some test data on a page where I am testing, so the data actually exists.
Any ideas, anyone? I posted this on the plugin author’s page, but have not heard anything yet… I need to get this working, so any input is greatly appreciated!
9 years, 8 months ago
just a follow-up as I have resolved this on my own…
the c2c function has to be AFTER the wp_head() function call in the header.php file for it to work.
I didn’t find that documented anywhere but stumbled onto it in desperate attempts to get this to work! 😉
9 years, 7 months ago
Thanks for sharing. Kept me from trial and error… 🙂