Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.4k views
in Themes by

I am using the snow flat theme. I am testing in an Ipad.

class qa_html_theme_layer extends qa_html_theme_base {
    public function body()
    {
        if (qa_is_mobile_probably()) {
            if(isset($this->content['sidepanel'])){
                unset($this->content['sidepanel']);
            }
        }
        qa_html_theme_base::body();
    }
}

Q2A version: 1.7.0

1 Answer

0 votes
by

You do not need to unset anything here. Just override the sidepanel method into your theme or plugin file. See in the SnowFlat or FlatBox. I have used mobile detection to switch the sidepanel.

Something like below code

public function sidepanel()
{
    
    if ( ! qa_is_mobile_probably() ) {
        qa_html_theme_base::sidepanel();
    }

}
by
Thank you @jatin.soni, but this was my first trying. The sidepanel goes to the end of the page after the questions. By the way, do you know anything about the theme that the other user is talking about?
by
The sidepanel section loads through sidepanel method and if you want to remove from the mobile device this is the best approach and it should work, until any other code conflicts. If you are using SnowFlat or FlatBox than this code is already in the theme.

I didn't get you for "user is talking about" can you please explain a bit?
by
Sorry, "the user is talking about" -> I was asking about the theme that @Technox was talking about. I have not tested yet, but although I am using q2a v. 1.7, it seems that I am using an older theme!?
by
That is Orange Candy theme by Q2A Market (me). It supports Q2A default features.
by
Thank you again! Also for the theme that you have been providing to us!
by
Is there a version (1.5?) of Snow Flat of the Candy theme that works in the stable version of 1.7 q2a?  I tried this one https://github.com/q2a/question2answer, but it didnt work!
...