• Hello,

    I’m not a full stack developer, so I’m struggling to understand the documentation file a bit. If someone could help explain what I’m doing wrong, that would be much appreciated.

    So we have a custom post type for Faculty, and on our Posts there is a custom field called “authors” that is used to select one or more Faculty members that have written that particular article. It’s essentially a custom way to select the author of a post.

    I’m trying to use APM so on the list of Posts, our editors can filter by that custom field of authors and see all posts written by a single author. Right now the actual “Author” of the articles are all just the editors, because the WP user defaults as the author. I’ve rigged the Posts display to show this field, but there is no way to search/filter by it.

    Here is the code in my functions.php file:

    add_action('init', 'setup_cpt_filters');
    
    function setup_cpt_filters() {
        // globalize it so that we can call methods on the returned object
        global $my_cpt_filters;
    
        // Allow for filtering posts by meta keys
        $filter_array = array(
            // The key is pretty essential. It's used in many places. Choose a unique key, preferably prefixed
            'authors_filter_key' => array(
                'name' => 'Author',
                'meta' => 'authors'
            )
        );
    
        $my_cpt_filters = tribe_setup_apm('post', $filter_array );
    }

    I originally had it say: ‘meta’ => ‘meta_key’

    Which is what the documentations shows. But I assumed that meant you should put the meta key there, not the text “meta_key”.

    It seems as though the filter option is available, but when I enter a term and apply the filter, nothing is ever found.

    Here is a screenshot of the Posts page:
    https://drive.google.com/file/d/1TwMDsdjDCbq9EQPzqgcX9gmarQ28xSE1/view?usp=sharing

    Also, we don’t want to use the Columns feature. Is there a way to remove/disable that? It takes up too much space and is unnecessary.

    Thank you to anyone who can guide me in the right direction!

    Steve

  • The topic ‘Nothing is working, not sure I’m setting it up right…’ is closed to new replies.