Support

Account

Home Forums Add-ons Gallery Field “Reverse Lookup” via Attachment Custom Field Reply To: “Reverse Lookup” via Attachment Custom Field

  • I don’t see anything wrong with this except that a shortcode should return the value, not output it

    
    // somewhere at the top of your shourtcode function
    ob_start();
    
    return ob_get_clean();
    // at the bottom or your shortcode function
    

    The only reason that it is returning no posts is that it has found no posts. This means that:

    1. the meta key you are searching on is wrong
    2. the attachment post does not have a value in this meta key
    3. there are no attachement posts with this meta value