Support » Plugin: 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 $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

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



    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.