• Resolved Matic Broz

    (@otterreviews)


    Hi,

    I’d love to use the get_rpwc2_order($post_type, $term_id); function, but I cannot seem to make it work properly.

    The problem is, all elements in the array $ranking have the same ID, which is of the current post.

    <?php
    $post_id = get_the_ID();
    $post_type = get_post_type($post_id);
    $term_id = get_the_terms( $post_id, 'category' );
    $ranking = get_rpwc2_order($post_type, $term_id);
    
    foreach ($ranking as $id ) {
    	$post = get_post ( $id );
    	setup_postdata( $post );
    	generate_do_template_part( 'archive' );
    }
    ?>

    I would appreciate your help =)

    • This topic was modified 2 years, 11 months ago by Matic Broz.
    • This topic was modified 2 years, 11 months ago by Matic Broz.
    • This topic was modified 2 years, 11 months ago by Matic Broz.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    apologies for the late reply, I started a new job this year and get quite busy.

    The problem is, all elements in the array $ranking have the same ID, which is of the current post.

    ok, but your sample code is wrong, the fn requires a term ID.

    You are getting your term ID from get_the_terms() which returns a term object.

Viewing 1 replies (of 1 total)
  • The topic ‘get_rpwc2_order’ is closed to new replies.