Viewing 2 replies - 1 through 2 (of 2 total)
  • cirrusblau

    (@cirrusblau)

    I’d be curious about this as well… Is there a way to list posts from only one category?

    cirrusblau

    (@cirrusblau)

    Figured it out, the change is very simple.

    In toc.php, find the function shortcode_sitemap_posts.

    Modify the first line to look like this (add the postcat portion):

    extract( shortcode_atts( array(
    'order' => 'ASC',
    'orderby' => 'title',
    'separate' => true,
    'postcat' => $this->options['postcat']
    ), $atts )
    );

    Modify the second line to look like this (add the category_name portion):

    $articles = new WP_Query(array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'order' => $order,
    'orderby' => $orderby,
    'posts_per_page' => -1,
    'category_name' => $postcat
    ));

    Sample useage is like this:

    [sitemap_posts postcat="SOPs" no_label="true" separate="false"]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Only show contents of one category – say’ is closed to new replies.