Androida: Ditching the ads

Posted by Greg October - 9 - 2009 - Friday

no_adsIt was never intentional for me to advertise for Envato and their marketplace for so long (and for free!), but for some reason I never got around to removing the ads. Not that there’s anything wrong with Envato– on the contrary, it’s one of the best places on the web to get themes, graphics, audio files, etc… (there, one last final freebie for them. ;) )

What I’m about to explain is hyper-obvious for anyone with web dev experience, but for those of you who are using the Androida Theme as users not as programmers, here’s how to get rid of the ads:

1. Log in as an administrator
2. Go to “Appearance” –> “Editor”
3. From the list of files to edit, select Sidebar (sidebar.php)
4. “Comment out” the line that loads the sponsors.

“Commenting out” means adding comment symbols (which are different from language to language to language) around a piece of code. These comment symbols tell the browser, “This is just a note… don’t do anything to render me.” The reason for using comments is so that you can easily reverse your changes later.

To add comments in HTML, you add “<!–” at the beginning of your comment and “–>” at the end. Now, I wasn’t sure if PHP would still get executed even from inside a comment (certain non-HTML code WILL get parsed, like the code in-between css style tags), but the first try of using the HTML comments showed that it in fact worked.

Here’s the change you need to make (note the comment symbols.. only one line is changed and the others are shown just for context):

1
2
3
4
5
6
<div class="clear"></div>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<!-- <?php include (TEMPLATEPATH . '/sponsors.php'); ?> -->

<?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?>

That’s it! No more ads. And easy to undo if I decide to put some ads in there.

Leave a Reply

About us

Monkey House is populated by three lovely and wonderful simians–Greg, his wife Alex, and their son Cole. He is a jack of all trades, she is a scientist/athlete, and their son is a poopsmith.