Home Forums General Issues Some posts hiccup with a different ACF structure


Some posts hiccup with a different ACF structure

  • I have a CPT with various ACF fields, including taxonomy and file. You can see it in action at: (Yeah, I’m developing a live site – I have no choice.) A few of the posts (one in English and about ten in Japanese, even though they are supposed to be identical duplicates – go figure!) act differently than the rest. Normally get_field() on a taxonomy is an object and get_field() on a file type is a string (the URL to the file). But in the case of the weird posts, get_field(taxonomy) is just an integer of the taxonomy ID, and get_field(file) is an array! Here are real var_dump’s from inside the post loop, for an example normal post and an example weird one:

    A normal one is ID#4938 – Taxonomy get_field(‘preacher’,4938) looks like this:

    object(stdClass)#4021 (10) {
      string(12) "Brian Bluett"
      string(12) "brian-bluett"
      string(16) "message_preacher"
      string(22) "Interim Pastor in 2014"
      string(3) "raw"

    And get_field(‘audio_file’) is simply the path to the file:

    string(72) ""

    A weird one is ID#4943 – Taxonomy get_field(‘preacher’,4943) is just the ID:


    And get_field(‘audio_file’) is an array:

    array(8) {
      string(0) ""
      string(10) "2014-10-12"
      string(0) ""
      string(0) ""
      string(10) "audio/mpeg"
      string(72) ""

    Anytime a post has this hiccup, all taxonomy fields and all file fields act this way – it is consistent within a given post.

    Since there are only a few weird ones, I assume I can just make them again from scratch, but soon I’ll be mostly entrusting the site maintenance to non-techies, so I would like to know what is causing it so that I can prevent it either by code or training.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.