1

I have a group of posts that can select a custom field 'Partner Content'. These posts then select their post author. The post author is a custom post type that has a relationship field that selects the 'Partner Company' associated with the post author.

I am now trying to set up a single-partner_company.php template that displays all posts associated with the specific company. My meta query looks like this:

<?php
    $current_company = $post;
    $comp_id   = $current_company->ID; 
    $comp_name = $current_company->post_title;
?>

<?php
    $current_company = $post;
    $comp_id   = $current_company->ID; 
    $comp_name = $current_company->post_title;
?>

<?php

    $args = array(
        'numberposts' => -1,
        'fields'      => 'ids',
        'post_type'   => 'partner_authors',
        'meta_query'  => array(
            'key'   => 'author_company',
            'value' => $current_company
        )
    );
    
    $authors = get_posts( $args );
    
    $post_args = array(
        'fields'      => 'ids',
        'numberposts' => 3,
        'post_type'   => 'post',
        'meta_query'  => array(
            'key'   => 'post_author',
            'value' => $authors
        )
    );

    $partner_posts = get_posts( $post_args );
    $count = 0;


?>

neither array is working for me. what am I doing wrong?

0 Answers0