Home › Forums › General Issues › Get ALL fields for ALL posts in one array › Reply To: Get ALL fields for ALL posts in one array
Again, thanx so much for the help here.
This almost does it – but for some reason, the code is generating four main arrays, but I only have two posts in my database. There should only be 2 WP_Post Object arrays, right? Here’s the output I got:
Array
(
[0] => WP_Post Object
(
[ID] => 194
[post_author] => 2
[post_date] => 2019-03-01 16:29:16
[post_date_gmt] => 2019-03-01 16:29:16
[post_content] => My Neighbor's house - sweet yard, Victorian feng shui
[post_title] => 2150 Lafayette Street Denver, 80205
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => open
[post_password] =>
[post_name] => 2150-lafayette-street-denver-80205
[to_ping] =>
[pinged] =>
[post_modified] => 2019-03-01 16:29:16
[post_modified_gmt] => 2019-03-01 16:29:16
[post_content_filtered] =>
[post_parent] => 0
[guid] => https://locatedenver.com/?p=194
[menu_order] => 0
[post_type] => post
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
[acf_fields] => Array
(
[call] => No
[hot] => Yes
)
)
[1] => WP_Post Object
(
[ID] => 188
[post_author] => 2
[post_date] => 2019-03-01 16:21:50
[post_date_gmt] => 2019-03-01 16:21:50
[post_content] => My house, tiny back yard, super loud, bonsai trees, shitty grass
[post_title] => 2144 Lafayette Street Denver, 80205
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => open
[post_password] =>
[post_name] => 2144-lafayette-street-denver-80205
[to_ping] =>
[pinged] =>
[post_modified] => 2019-03-01 16:26:01
[post_modified_gmt] => 2019-03-01 16:26:01
[post_content_filtered] =>
[post_parent] => 0
[guid] => https://locatedenver.com/?p=188
[menu_order] => 0
[post_type] => post
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
[acf_fields] => Array
(
[call] => Yes
[hot] => Yes
)
)
[2] => WP_Post Object
(
[ID] => 194
[post_author] => 2
[post_date] => 2019-03-01 16:29:16
[post_date_gmt] => 2019-03-01 16:29:16
[post_content] => My Neighbor's house - sweet yard, Victorian feng shui
[post_title] => 2150 Lafayette Street Denver, 80205
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => open
[post_password] =>
[post_name] => 2150-lafayette-street-denver-80205
[to_ping] =>
[pinged] =>
[post_modified] => 2019-03-01 16:29:16
[post_modified_gmt] => 2019-03-01 16:29:16
[post_content_filtered] =>
[post_parent] => 0
[guid] => https://locatedenver.com/?p=194
[menu_order] => 0
[post_type] => post
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
[acf_fields] => Array
(
[call] => No
[hot] => Yes
)
)
[3] => WP_Post Object
(
[ID] => 188
[post_author] => 2
[post_date] => 2019-03-01 16:21:50
[post_date_gmt] => 2019-03-01 16:21:50
[post_content] => My house, tiny back yard, super loud, bonsai trees, shitty grass
[post_title] => 2144 Lafayette Street Denver, 80205
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => open
[post_password] =>
[post_name] => 2144-lafayette-street-denver-80205
[to_ping] =>
[pinged] =>
[post_modified] => 2019-03-01 16:26:01
[post_modified_gmt] => 2019-03-01 16:26:01
[post_content_filtered] =>
[post_parent] => 0
[guid] => https://locatedenver.com/?p=188
[menu_order] => 0
[post_type] => post
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
[acf_fields] => Array
(
[call] => Yes
[hot] => Yes
)
)
)
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.