Search code examples
phphtmlwordpresswordpress-themingcustom-wordpress-pages

Themosis Framework Collection Loop - WordPress


I've been using Themosis for a while now and am new to the "Collection" metafield.

I have the following metadata retrieved from my Collection of [type => "image"]:

a:9:{i:0;s:4:"1892";i:1;s:4:"1891";i:2;s:4:"1890";i:3;s:4:"1888";i:4;s:4:"1887";i:5;s:4:"1886";i:6;s:4:"1885";i:7;s:4:"1884";i:8;s:4:"1883";}

Additionally, I know i = index and the quoted numbers are the image attachment IDs. What is the a:9 and s:4 in any case?

I can't seem to find any Themosis documentation on how to loop through a collection with metadata as described above.


Solution

  • This was your serialized array you need to unrealized this array before getting this.

    a:9:{i:0;s:4:"1892";i:1;s:4:"1891";i:2;s:4:"1890";i:3;s:4:"1888";i:4;s:4:"1887";i:5;s:4:"1886";i:6;s:4:"1885";i:7;s:4:"1884";i:8;s:4:"1883";}
    

    You can use unserialize() function to full fill your achievement.