Lets say your object array looks like this when you <?php print_r($this) ?>

td_module_6 Object ( [post] => WP_Post Object ( [ID] => 6183 [post_author] => 3 [post_date] => 2017-05-30 19:25:14 [post_date_gmt] => 2017-05-30 11:25:14

and you want to Echo the [ID] only. You just need to use this php command

echo $this->post->ID

Your echo will output 6183. Congrats. Whenever you want to echo an Object, use this -> compare to regular array you will use [ ]

Leave a Reply