• jrhoh

    (@jrhoh)


    I would like to know where in the wordpress plugin editor I can find the coding for the textbox where you ask a question. I have looked through several of the files and I just can’t find it. I would like to remove the option to type code into this box as my users do not need to be typing code into the ask a question box. Please inform me on where I can find the coding for the text box. Thank you.

    https://wordpress.org/plugins/dw-question-answer/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author DesignWall

    (@designwall)

    Hi,

    You can add the following code to the functions.php file of your theme:

    add_filter( 'dwqa_tinymce_toolbar1', 'dwqa_disable_tinymce_options' );<br />
    function dwqa_disable_tinymce_options( $button ) {<br />
           return 'bold,italic,underline,|,'.'bullist,numlist,blockquote,|,'.'image,|,'.'spellchecker,fullscreen,|,';<br />
    }

    Hope this helps!
    Dominic from DesignWall team.

    Thread Starter jrhoh

    (@jrhoh)

    That did some of what I wanted it to do. One thing though, I would also like to remove the tab that says text on it as my users do not need this tab either. If you could get me the code that would remove that tab too, that would be greatly appreciated. Thank you.

    Plugin Author DesignWall

    (@designwall)

    You can add the following code to the style.css file:

    .wp-switch-editor {
        display: none;
    }

    Hope this helps!

    Thread Starter jrhoh

    (@jrhoh)

    Thank you, that seemed to work just fine, I just had one more question. I noticed that the post time for the questions/answers was off by six hours. I was wondering if there was a way to fix that and, if possible, how I would go about fixing that. Thanks.

    Plugin Author DesignWall

    (@designwall)

    To resolve the time issue on your site you can do the following solution:
    About list question page, you can open the content-question.php file, find line 17.
    Replace it with the following code:

    $time = human_time_diff( get_post_time( 'U' ), current_time('timestamp'));

    you can open the content-single-question.php file and find the line 19.
    Replace the following code:

    <?php printf( __( '<span>%s%s %s asked %s ago</span>', 'dwqa' ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(), dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( 'U' ) ) ) ?>

    With new code:

    <?php printf( __( '<span>%s%s %s asked %s ago</span>', 'dwqa' ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), dwqa_get_author(), dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( 'U' ), current_time('timestamp') ) ) ?>

    Regards,
    Dominic from DesignWall Team.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Code for ask a question text box’ is closed to new replies.