• neotoxic

    (@neotoxic)


    I am using Custom Field Templates to create posts “types”; news, review or interview for example. I can identify the type of post by looking at the post Template ID.

    I would like to be able to query the database to get the last 10 posts that use the Template ID of 2 for example.

    As the information is stored in what I think is a serialised array within the custom_field_template_data meta field, I have realised that querying this data might not be possible. I hope I am wrong about that, and would be very thankful if someone could show me how I could be queried.

    I assume its not as simple as: –

    $postslist = get_posts('numberposts=20&order=DESC&orderby=post_date&meta_key=custom_field_template_data->posts&meta_value=2');

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter neotoxic

    (@neotoxic)

    Ahh.. OK I see, so the date is stored in an array in the options table? is that right? That’s crazy. I guess there isn’t going to be any way I can do this then ??

    Could anyone help me out, give me some thoughts?

    HeroicNate

    (@heroicnate)

    wordpress 3.0 will have support for actual post types if you can wait.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Custom Field Template] Query posts based on Template ID’ is closed to new replies.