narzan
asked 7 years ago

I’m trying to modify the forum on my website. What I want is just to add a new field to it. I managed to add the fields to the page where people submit their questions. This is the code for that:

<p>
    <label for="pctest"><?php _e( 'الفحص على الكمبيوتر:', 'dwqa' ) ?></label>
    <?php $pctest = isset( $_POST['pctest'] ) ? sanitize_text_field( $_POST['pctest'] ) : ''; ?>
    <input type="text" class="" name="pctest" value="<?php echo $pctest ?>" >
</p>

From what I know I should add a code to make the field saved so I added this code in handle file:

    $pctest = isset( $_POST['pctest'] ) ?
    esc_html( $_POST['pctest'] ): '';

Now to show the code in the page where people can read the question I added this code:

 <?php
   $pctest = get_post_meta( get_the_ID(), '_dwqa_question_pctest', true );
   echo 'الفحص على الكمبيوتر: '. $pctest;
 ?>

My problem is: The text inside that field doesn’t show at all! after submitting the question. Check the pic below, The title of the field correct “in the green square” but the text inside that field empty “in the red square”

1 Answers
DominicStaff
answered 7 years ago

Firstly, you can refer the following question, If you still face their issue, you can send me username & password of your site for further checking, I will help you resolve it as soon as possible. 
https://www.designwall.com/question/add-two-fields-in-the-question-submit-from-dw-question-answer-pro/

Powered by DW Question & Answer Pro