[Resolved] CSS or PHP Function to Remove Footer + Copyright Bar on Mobile?

Home Forums Support [Resolved] CSS or PHP Function to Remove Footer + Copyright Bar on Mobile?

Home Forums Support CSS or PHP Function to Remove Footer + Copyright Bar on Mobile?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1370039
    Andres

    Hello,

    Is it better to use CSS or a php function to remove the footer + copyright bar on mobile? Which one results in a page with fewer assets loading and better performance?

    I’m currently using this CSS to disable the footer and copyright in mobile:

    @media (max-width: 768px) {
        .site-footer {
            display: none;
        }
    }

    For performance on mobile, is it better to use a function like the one below from post-1344401?

    add_action( 'wp', function() {
        if ( wp_is_mobile() && is_user_logged_in() ) {
            remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
            remove_action( 'generate_footer', 'generate_construct_footer', 10 );
        }
    } );

    Thank you and have a good day.

    Cheers!

    Andrés

    #1370044
    Leo
    Staff
    Customer Support

    Hi there,

    PHP is generally better when it can be used.

    I doubt you will see much difference here though if you run your site through speed test for both solutions 🙂

    #1370082
    Andres

    Hi Leo,

    Thank you!

    Andrés

    #1370102
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.