Forums

[Plugin: Custom Field Template] Query posts based on Template ID (3 posts)

  1. neotoxic
    Member
    Posted 2 years ago #

    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');

  2. neotoxic
    Member
    Posted 2 years ago #

    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?

  3. HeroicNate
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic