Everything above work in admin, checked boxes stay checked, it write value “1” in database if checked for ‘home’.
My problem is to list all attachments with value “1” on homepage with link parent post.
I try with get_posts() , but everything works good for all attachments but I cant figure out how to filter attachments with “_attachments” meta key value ‘home’ = 1
I understand that ‘home’ value is serialized in “_attachments” but how to unserialize and use that value is where I fail.
I have manage to list attachments on home page as I wanted with little modified copy of attachments_get_attachments function , but now I get all attachments with checked new value HOME in some order.
My goal is to list only 25 attachments with value HOME in random order, so every time visitor refresh page gets different attachments.
Viewing 1 replies (of 1 total)
The topic ‘Show all checked attachments on home page’ is closed to new replies.