WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] categoty param in get_posts (2 posts)

  1. luismldias
    Member
    Posted 1 year ago #

    Hi,

    I am having a problem with a simple piece of code and it's beed troubling me because, as far as i can see, the code is "by the book".

    I am trying to list all posts for a category of a custom post type. When i use the get:posts function for the post type the results are ok, but when i add the category argument it returns an empty array. Has anyone has this issue?

    The code is the following:

    $args = array(
    'post_type'=>'zen_art_newsletter',
    'post_status'=>'publish',
    'orderby'=>'post_date',
    'order'=>'DESC',
    'suppress_filters'=>0,
    'category'=>530
    );

    $newsletterPosts = get_posts($args);

    Regards and thanks in advance,

    Luis Dias

  2. luismldias
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic