WordPress.org

Support

Support » Plugins and Hacks » Custom Fields Creator

Custom Fields Creator

  • i using below code at single.php

    [ Mod note: for code, please use the code button or backticks instead of blockquote. Much easier to read that way. ]

    <?php
    	get_header();
    	include(THEME_LIB.'/template_posts.php');
    	get_footer();
    ?>
    <?php $Information = get_post_meta($post->ID, "Information", true);
    if( !empty($Information) )
    foreach($Information as $Information) {echo $Information ['Platform'];} ?>
    foreach($Information as $Information) {echo $Information ['License'];} ?>

    but the custom field still not show

    http://demo.mlch.antserve.com/?p=63

    http://wordpress.org/extend/plugins/custom-fields-creator/

Viewing 1 replies (of 1 total)
  • Plugin Contributor madalin.ungureanu

    @madalinungureanu

    Hi!

    At a first glance there are a couple of mistakes in your code:

    – in the get_post_meta function the meta key should be lowercase “information”
    – same goes for the array keys when you are echoing stuff out: ‘platform’ and ‘license’
    – the foreach statement is wrong

    <?php $Informations = get_post_meta($post->ID, "information", true);
    if( !empty($Informations) )
    foreach($Informations as $Information) {echo $Information ['platform'];}
    foreach($Informations as $Information) {echo $Information ['license'];} ?>

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Fields Creator’ is closed to new replies.