×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Rodrigo (Digão) Ferreira
Added: May 18, 2016 11:33 AM
Views: 2030
Tags: wordpress
  1. <?php $getPost=get_post($post_id); // Get all the data ?>
  2.  
  3.             <?php
  4.                 foreach($getPost as $name=>$value) {
  5.  
  6.                     echo "<strong>".$name."</strong>"."  =>  ";
  7.                     echo "<strong>".$value."</strong>";
  8. /*                    
  9. foreach($value as $nameAr=>$valueAr) {
  10.                             echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  11.                             echo $nameAr."  =>  ";
  12.                             echo var_dump($valueAr);
  13.                     }
  14. */
  15.                     echo "<br /><br />";
  16.  
  17.                 }
  18.             ?>
  19.  
  20.             <?php $getPostCustom=get_post_custom(); // Get all the data ?>
  21.  
  22.             <?php
  23.                 foreach($getPostCustom as $name=>$value) {
  24.  
  25.                     echo "<strong>".$name."</strong>"."  =>  ";
  26.  
  27.                     foreach($value as $nameAr=>$valueAr) {
  28.                             echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  29.                             echo $nameAr."  =>  ";
  30.                             echo var_dump($valueAr);
  31.                     }
  32.  
  33.                     echo "<br /><br />";
  34.  
  35.                 }
  36.             ?>