Add header text to Q & A Page?

Is it possible to add some text above the Q & A pages?

thanks

  • aristath

    Hello there @Kimberly, I hope you're well today!

    You can add this in your theme's functions.php file or use this plugin instead of editing your theme files: https://wordpress.org/plugins/code-snippets/

    function ari_qa_custom_content( $case ) { ?>
    
    	<?php if ( 'archive-question' == $case ) : ?>
    		This text appears on question archives
    	<?php elseif ( 'ask-question' == $case ) : ?>
    		This text appears on the ask question page
    	<?php elseif ( 'edit-answer' == $case ) : ?>
    		This text appears on the edit answer screen
    	<?php elseif ( 'edit-question' == $case ) : ?>
    		This text appears on the edit question screen
    	<?php elseif ( 'single-question' == $case ) : ?>
    		This text appears on single questions
    	<?php endif;
    
    }
    add_action( 'qa_before_content', 'ari_qa_custom_content', 10, 1 );

    You can then change the text I have included in my code above to show the text you want depending on what is being displayed.

    I hope that helps!

    Cheers,
    Ari.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.