Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
5.9k views
in Q2A Core by
edited by
Is there an easy solution for adding text (or html) between the menu navigation and the headline "Recent questions and answers" on the main page?

1 Answer

0 votes
by

yes there is, answering myself:

override main function, put following code in qa-theme.php:

        function main() {
            $content=$this->content;

            // HERE goes the extra HTML
           $this->output('<p>Test</p>');

            
            $this->output('<DIV CLASS="qa-main'.(@$this->content['hidden'] ? ' qa-main-hidden' : '').'">');
            
            $this->widgets('main', 'top');
            
            $this->page_title_error();        
            
            $this->widgets('main', 'high');

            $this->main_parts($content);
               
            $this->widgets('main', 'low');

            $this->page_links();
            $this->suggest_next();
            
            $this->widgets('main', 'bottom');

            $this->output('</DIV> <!-- END qa-main -->', '');
        }
 

Hope that is helpful for others ;)

by
Thanks
But is show static text.
how i show dynamic text
by
This might work, call a function inside output to retrieve dynamic content:
$this->output( getDyn() );

function getDyn() {
  return "The number is: ".rand(0,10);
}
...