WordPress.org

Forums

Pods - Custom Content Types and Fields
[resolved] Additional Comment Field to Specific Categories Only (4 posts)

  1. hichloe
    Member
    Posted 1 year ago #

    Hello,
    I successfully created an additional comment field (named "comment title"), but I would like to make this field appear to certain categories only.

    For instance, the "comment title" field appears on a comment box in category A, but not for category B.

    How can I achieve this?

    Thank you in advance,

    http://wordpress.org/plugins/pods/

  2. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Before your form, try:

    <?php
    $fields = array();
    
    // see http://codex.wordpress.org/Function_Reference/is_category
    if ( is_category( 'A' ) ) {
        $fields[] = 'comment_title';
    }
    
    pods_group_add( 'comment', 'Comments', $fields );
    ?>
  3. hellenahandbasket
    Member
    Posted 1 year ago #

    Um...where would that go? "Before (my) form" where?

    Thanks

  4. maiki
    Member
    Posted 1 year ago #

    The comment form, in yer theme.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.