Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

287
Views
Is there a code that will use CSS to hide a class if within a certain window-type?

I'm currently trying to create an app from my WordPress site but when I do, I'm running into the issue of the header, right sidebar, and footer showing. I'd ultimately like to hide these if they appear within a window without a URL option. I'm not even sure that's viable.

What's happening is that the app maker is pulling in pages from my WordPress site and displaying like an app. Except for the header, sidebar, and footer unnecessarily being there. I can't hide these based on screen because I still want people with mobile devices to be able to see if they're looking on a browser window.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You could tell the app maker to call the url with an extra param like ?hide_ui=1 and then in your site use JS to check if that param is present in the url and hide the elements you don't want visible in the app.

about 4 years ago · Juan Pablo Isaza Report

0

CSS does not have the power to do this, it's something that needs to be done either with client-side (JS) or server-side. The latter would probably be a cleaner and easier option.

On the server side, with PHP you can do the following:

$hide_stuff = (isset($_GET['hide']) && trim($_GET['hide']) == '1');

if ($hide_stuff) {
    echo '<link rel="stylesheet" type="text/css" href="/path/to/file.css">';
}

So that when the page URL includes ?hide=1 the server will automatically add /path/to/file.css to the page. Then, in file.css you can simply do whatever you want, like hiding elements.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!