how to display all posts Custom fields dynamically?

    <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 left_column"> <?php
      if (have_posts()) : 
        while (have_posts()) : the_post(); ?>
        <h1> <?php the_title();?> </h1> <?php 
        $post_meta = get_post_meta(get_the_ID());
        foreach($post_meta as $key=>$value)
        { 
            echo "<strong>".$key."</strong>"."  =>  ";
            foreach($value as $nameAr=>$valueAr)
            {
                echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                echo $nameAr."  =>  ".$valueAr; 
            }
            echo "<br >";       
        }
        the_content(); 
        endwhile;
        endif; ?>
      </div>

Leave a Comment