WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] c2c_get_custom plugin meta fields question in head (3 posts)

  1. syncbox
    Member
    Posted 7 years 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!

  2. syncbox
    Member
    Posted 7 years 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! ;)

  3. _erik_
    Member
    Posted 6 years ago #

    Thanks for sharing. Kept me from trial and error... :)

Topic Closed

This topic has been closed to new replies.

About this Topic