Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
in Q2A Core by
i want to write different header for desktop and mobile  for q2a theme , should i use css to hide headers or create a php syntax in qa-theme

1 Answer

0 votes
selected by
Best answer

It depends a bit on what your end result should look like. With CSS you can format elements or hide them entirely. You can even re-arrange them (to some degree) with techniques like flexbox layout. But if you need to make fundamental changes to the header section structure or its content, doing it in PHP is probably the way to go. For that you'd override the body_header() method in the file qa-theme.php of your theme.

Essentially, PHP produces HTML, which defines the content of a page and its structure. CSS defines how that content should be displayed.