What theme are you using, and what are you trying to accomplish? Can you post the contents of footer.php to Pastebin and post the link here?
Also, can you clarify why using some custom CSS to hide the section is a non-starter? You wouldn’t necessarily have to create a child theme; you could use a custom CSS plugin instead or your theme’s built-in custom CSS option, if it has one. Bear in mind that if you manually edit the theme files, you’ll lose those changes if the theme is ever updated in the future, to fix security issues or bugs or to add new features.
http://pastebin.com/EYUZ92bF
I’m trying to comment out the one line of code in that file to remove the “Back To Top” link that appears in the footer. I’m using a premium theme called florence BUT, I experienced the same behavior with 20-14 default theme in CSS and PHP files.
Using custom CSS isn’t necessarily a non-starter; I just want to know why I can’t comment out code like in any other normal html, php, css files?
I prefer to back up my revisions and not use child themes, I don’t like redundancy regardless of how minimal the performance is affected. But even using a child theme is just a hack; why can’t I simply comment out code in already created wordpress content files?
You either need to use HTML-style comments to eliminate that entire line:
<!--<a href="#" class="to-top"><?php _e( 'Back to top', 'solopine' ); ?> <i class="fa fa-angle-double-up"></i></a>-->
or you need to use PHP-style comments just inside the PHP block:
<a href="#" class="to-top"><?php // _e( 'Back to top', 'solopine' ); ?> <i class="fa fa-angle-double-up"></i></a>
Either would work.
To answer your second question, you technically are never required to use a child theme. However, as I posted before, if you edit the theme files directly, you’ll lose those changes if the theme is ever updated, to fix security issues or bugs or to add new features.
Thank you Stephen. I guess I needed a comment lesson/refresher.
I never tried using html comments, it being a php file. And I had overlooked that php comments need to be placed inside the php tags to eliminate the called functions. I have very little experience with php scripting.
Again, thanks so much