sahi
asked 7 years ago

Hi,
I’m a not so techie person and new to CSS coding.
I would like to disable Title, Category and Tag in my Forum..I just want a box where visitors can directly post questions without giving title. Could you please help me out with this.

I’m reposting this question as I’m not able to see the solution that you have given in the earlier post. I would like to make changes in the CSS code.

I found this solution to disable Category and Tag (from designwall)

.dwqa-container .dwqa-content-edit-form #question-category,
.dwqa-container .dwqa-content-edit-form label[for=question-category],
.dwqa-container .dwqa-content-edit-form input[name=question-tag],
.dwqa-container .dwqa-content-edit-form label[for=question-tag] {
display: none !important;
}

It works good. Similarly can you let me know the code to disable Title too.

Thank you.

3 Answers
DominicStaff
answered 7 years ago

If you want to remove the Title, Category, and Tag in your ask question page, you can open the Handle.php and question-submit-form.php files.
+ In the Handle.php file you can remove the line code: 373, 398, 443.
+ In the question-submit-form.php file, you can replace the code in your file with the following code:

<?php
/**
 * The template for displaying single answers
 *
 * @package DW Question & Answer
 * @since DW Question & Answer 1.0.1
 */
?>
 <?php do_action( 'dwqa_before_question_submit_form' ); ?>
<?php if ( dwqa_current_user_can( 'post_question' ) ) : ?>
 <form method="post" class="dwqa-content-ask-form">
 <p class="dwqa-search">
 <label for="question_title"><?php _e( 'Title', 'dwqa' ) ?></label>
 <?php $title = isset( $_POST['question-title'] ) ? $_POST['question-title'] : ''; ?>
 <input type="text" data-nonce="<?php echo wp_create_nonce( '_dwqa_filter_nonce' ) ?>" id="question-title" name="question-title" value="<?php echo $title ?>" tabindex="1">
 </p>
 <?php $content = isset( $_POST['question-content'] ) ? $_POST['question-content'] : ''; ?>
 <p><?php dwqa_init_tinymce_editor( array( 'content' => $content, 'textarea_name' => 'question-content', 'id' => 'question-content' ) ) ?></p>
 <?php global $dwqa_general_settings; ?>
 <?php if ( isset( $dwqa_general_settings['enable-private-question'] ) && $dwqa_general_settings['enable-private-question'] && is_user_logged_in() ) : ?>
 <p>
 <label for="question-status"><?php _e( 'Status', 'dwqa' ) ?></label>
 <select class="dwqa-select" id="question-status" name="question-status">
 <optgroup label="<?php _e( 'Who can see this?', 'dwqa' ) ?>">
 <option value="publish"><?php _e( 'Public', 'dwqa' ) ?></option>
 <option value="private"><?php _e( 'Only Me &amp; Admin', 'dwqa' ) ?></option>
 </optgroup>
 </select>
 </p>
 <?php endif; ?>
 <p>
 <label for="question-category"><?php _e( 'Category', 'dwqa' ) ?></label>
 <?php
 wp_dropdown_categories( array(
 'name' => 'question-category',
 'id' => 'question-category',
 'taxonomy' => 'dwqa-question_category',
 'show_option_none' => __( 'Select question category', 'dwqa' ),
 'hide_empty' => 0,
 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ),
 'selected' => isset( $_POST['question-category'] ) ? $_POST['question-category'] : false,
 ) );
 ?>
 </p>
 <p>
 <label for="question-tag"><?php _e( 'Tag', 'dwqa' ) ?></label>
 <?php $tags = isset( $_POST['question-tag'] ) ? $_POST['question-tag'] : ''; ?>
 <input type="text" class="dwqa-question-tags" name="question-tag" value="<?php echo $tags ?>" >
 </p>
 <?php if ( dwqa_current_user_can( 'post_question' ) && !is_user_logged_in() ) : ?>
 <p>
 <label for="_dwqa_anonymous_email"><?php _e( 'Your Email', 'dwqa' ) ?></label>
 <?php $email = isset( $_POST['_dwqa_anonymous_email'] ) ? $_POST['_dwqa_anonymous_email'] : ''; ?>
 <input type="email" class="dwqa-question-anonymous-email" name="_dwqa_anonymous_email" value="<?php echo $email ?>" >
 </p>
 <p>
 <label for="_dwqa_anonymous_name"><?php _e( 'Your Name', 'dwqa' ) ?></label>
 <?php $name = isset( $_POST['_dwqa_anonymous_name'] ) ? $_POST['_dwqa_anonymous_name'] : ''; ?>
 <input type="text" class="dwqa-question-anonymous-name" name="_dwqa_anonymous_name" value="<?php echo $name ?>" >
 </p>
 <?php endif; ?>
 <?php wp_nonce_field( '_dwqa_submit_question' ) ?>
 <?php dwqa_load_template( 'captcha', 'form' ); ?>
 <input type="submit" name="dwqa-question-submit" class="dwqa-btn dwqa-btn-primary" value="<?php _e( 'Submit', 'dwqa' ) ?>" >
 </form>
<?php else : ?>
 <?php if ( is_user_logged_in() ) : ?>
 <div><?php _e( "You doesn't have permission to post a question", 'dwqa' ) ?></div>
 <?php else : ?>
 <div class="dwqa-answers-login">
 <div class="dwqa-answers-login-title">
 <p><?php printf( __( 'Please login or %1$sRegister%2$s to submit your answer', 'dwqa' ), '<a href="'.wp_registration_url().'">', '</a>' ) ?></p>
 </div>
 <div class="dwqa-answers-login-content">
 <?php wp_login_form(); ?>
 <?php do_action( 'wordpress_social_login' ); ?>
 </div>
 </div>
 <?php endif; ?>
<?php endif; ?>
<?php do_action( 'dwqa_after_question_submit_form' ); ?>
sahi
answered 7 years ago

Thanks for your answer. Is there a possibility to disable title through CSS rather than PHP files.

sahi
replied 7 years ago

This worked..Thank you

DominicStaff
answered 7 years ago

If you have any issue or question, please let me know, I will check and help you resolve it.

sahi
replied 7 years ago

I tried this also.

.dwqa-container .dwqa-content-edit-form label[for=question_title],
.dwqa-container .dwqa-content-edit-form input[name=question-title] {
display: none !important;
}

This worked too for removing Title.

Could u please let me know if there would be any issue with this later on?

Dominic Staff
replied 7 years ago

If you use the CSS code, you can remove the sections but the title still show the request, you need the title. So, you need to remove the request check code in the PHP file.

sahi
replied 7 years ago

Did you mean, the input for TITLE will disappear but the TITLE label will be shown?

Dominic Staff
replied 7 years ago

yes, your css code will hide the text field not label. I think you should remove the code line in the php file that I have help you in the previous answer to resolve this issue.

sahi
replied 7 years ago

Title Label is also removed using CSS code 🙂
Will try editing PHP file orelse.

Dominic Staff
replied 7 years ago

Yes, I have some mistake in your comment, I do not see detail your CSS code, Sorry about that. If you have any issue or question, you can let me know, I will check and help you resolve it.

Powered by DW Question & Answer Pro