Q2A: making the main content div appear before the side panel

After checking the Question2Answer pages’ HTML code, I find that the main div comes after the side panel.

How to revert the position of the main div and side panel div? Makes the main content come first in the HTML.

You can change the displaying order by overwriting the body_content() function in the theme (that is, you need to customize the Q2A theme).

Just edit the qa-theme.php file in the theme and adding this function in the class qa_html_theme that extends qa_html_theme_base:

function body_content()
{
        $this->body_prefix();
        $this->notices();

        $this->output('<DIV CLASS="qa-body-wrapper">', '');

        $this->widgets('full', 'top');
        $this->header();
        $this->widgets('full', 'high');
        $this->main();
        $this->sidepanel();
        $this->widgets('full', 'low');
        $this->footer();
        $this->widgets('full', 'bottom');

        $this->output('</DIV> <!-- END body-wrapper -->');

        $this->body_suffix();
}
Answered by SA.

Leave a Reply

Your email address will not be published. Required fields are marked *