Your Time:
Our Time:
← Back to discussions

Excluding categories and allowing comments

Need help with a different issue? Search the forums or open a new ticket.
Open a support ticket

This topic has 4 replies, 2 voices, and was last updated 12 years, 10 months ago by Fem.

  • 2013-11-08 at 1:52 am
    Support Expired
    #575
    TheBandWagon
    Participant
    • Topics: 3
    • Replies: 5
    • Total posts: 8
    • Post count: 9

    Hi,

    I have added a taxonomy to the Artists custom post type, I would like to exclude posts from a certain category from displaying on the Artists page. I’ve tried adding this to the array but it still shows all posts without excluding any from the category id 3 (its the up and coming artists I want excluded):

    $args = array(
    ‘post_type’ => ‘artists’,
    ‘posts_per_page’=> $artist_limit,
    ‘paged’ => $paged,
    ‘post__not_in’ => array(3)

    );

    Also I would like to allow comments to be posted on custom type posts, such as on the album review pages, I’ve tried adding the follwing code to the single-albums.php file but it doesnt work:

    <?php
    $comments = get_option(‘atp_commentstemplate’);
    if ( $comments == ‘posts’ || $comments == ‘both’ ) {
    comments_template( ”, true );
    }?>

    You can see the site in development here: http://dev.agtdesigns.co.uk/

    Any help really appreciated.

    regards

    Andy

    • This topic was modified 12 years, 10 months ago by TheBandWagon.
    • This topic was modified 12 years, 9 months ago by Fem.
    2013-11-08 at 10:43 am
    #578
    Fem
    Keymaster
    • Topics: 2
    • Replies: 5215
    • Total posts: 5217
    • Post count: 6003

    I’m online in Skype if you would like to communicate. BTW I have seen that you have only 1 category so if you exclude how will it show you the other categories its nothing there to exclude.

    Regarding the comments i have added support in albums for the comments

    Regards
    Maqk

    2013-11-08 at 4:49 pm
    Support Expired
    #587
    TheBandWagon
    Participant
    • Topics: 3
    • Replies: 5
    • Total posts: 8
    • Post count: 9

    Thankyou for adding support for comments in albums, could you tell me how you did this as I would like to add comments to the Gigs pages too.

    I only want to exclude posts from that one catgeory, do I need to setup a ‘generic’ category for all the other posts?

    Thanks

    2013-11-08 at 4:59 pm
    Support Expired
    #588
    TheBandWagon
    Participant
    • Topics: 3
    • Replies: 5
    • Total posts: 8
    • Post count: 9

    I’ve managed to achieve the catgeory filtering a different way by adding another catgeory and using this code:

    $args = array(
    ‘post_type’ => ‘artists’,
    ‘posts_per_page’=> $artist_limit,
    ‘paged’ => $paged,
    ‘artists_cat’ => ‘Established’

    );

    Still need help with adding comments for the gigs pages though please.

    2013-11-08 at 7:21 pm
    #602
    Fem
    Keymaster
    • Topics: 2
    • Replies: 5215
    • Total posts: 5217
    • Post count: 6003

    open musicplay/musicband/albums/ album.php file and in that find the below line

    'supports'    => array('title','thumbnail', 'page-attributes','editor',),
    

    and in the last after ‘editor’, add like this ‘comments’ see the code below to see how it looks like after adding.

    'supports'    => array('title','thumbnail', 'page-attributes','editor','comments'),
    

    similarly for other post types if you wish to add
    and after that in the single-albums.php page you can add the comments code before inner and pagemid as shown below

    
    
    
    

You must be logged in to reply to this topic.