0

I have this line

<? if(!$_SERVER['HTTP_X_PJAX']){  require_once("footer.php"); } ?>

Is there a way that I can add this class:

no-tablet-portrait no-phone
3
  • 2
    Can't you just add those classes to a container inside footer.php? Commented Dec 11, 2014 at 20:25
  • 1
    PHP outputs HTML. Whatever HTML you output can have css classes applied to them. For example: echo '<div class="no-tablet-portrait no-phone">'. You can't add it to the code above because it's not generating HTML directly. Commented Dec 11, 2014 at 20:27
  • 1
    Hope this previous thread helps: stackoverflow.com/questions/25336229/adding-css-to-php Commented Dec 11, 2014 at 20:33

2 Answers 2

1

PHP Operates within HTML. Therefore, you can just use <style> or <link> instead, before the <?php

Also, you should be doing it within footer.php

Sign up to request clarification or add additional context in comments.

Comments

0

Edited the footer.php.

<div class="bg-dark no-tablet-portrait no-phone">
        <div class="container tertiary-text bg-dark fg-white" style="padding: 10px">

        All right reserved. Copyright &copy; 2014 -
        <a class="pjaxer" href="<? echo $GLOBALS["sys"]->get_url(); ?>page/tos" ><? echo lng_menu_tos; ?></a> - 
        <a class="pjaxer" href="<? echo $GLOBALS["sys"]->get_url(); ?>page/privacy" ><? echo lng_menu_privacy; ?></a> - 
        <a class="pjaxer" href="<? echo $GLOBALS["sys"]->get_url(); ?>page/disclaimer" ><? echo lng_menu_disclaimer; ?></a> - 
        <a class="pjaxer" href="<? echo $GLOBALS["sys"]->get_url(); ?>page/contact" ><? echo lng_menu_contact; ?></a>
        </div>

Now it's hidden on all the pages for mobile and tablets, didn't need to edit every single page.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.