WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
[resolved] Query all posts with custom_field (4 posts)

  1. teamlinx
    Member
    Posted 1 year ago #

    I read through and didn't see this so if I missed it please send me a link.

    I want to query all posts that contain a certain custom_field value.
    So if the custom field was "color" and two posts had this custom field with the value "red" i want to click "red" and be shown the two post that have that value.

    Pseudo Code
    <?php
    echo '' . print_custom_field('color') . '';
    ?>

    Any help would be appreciated.

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. teamlinx
    Member
    Posted 1 year ago #

    <?php
    echo '<a href="'. get_custom_field_links('color', 'red') .'">' . print_custom_field('color') . '</a>';
    ?>
  3. teamlinx
    Member
    Posted 1 year ago #

    Here is the link in the documentation to solve this problem.
    You can also use 'permalink' next to post_title

    https://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_posts_sharing_custom_field_value

    good documentation btw!

  4. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    Glad you found a solution -- I try to keep the docs up to date, but there are plenty of other examples and use-cases that should be added. Marking this as resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic