Posted on

How to insert content at the beginning or end of a WordPress post

I am trying to optimise Adsense earnings of my WordPress website Smartroman.co.uk by inserting ads at the beginning and end of the post. If you want to do something similar, insert an advertisement, image, or additional paragraphs to the beginning or end of the post, you may use following trick.

Basically, you need to use so called filters and add a php code to one of your WordPress Theme files. The code needs to be inserted into functions.php file that is located in Website-root/wp-content/themes/name-of-your-theme/. First download this file using FTP client. I think it is a good idea to copy it into two locations of your computer. If something goes not according to the plan and your WordPress website breaks down, you will be able to easily restore it using the original file 🙂

Continue reading How to insert content at the beginning or end of a WordPress post

Posted on

How to show the battery percentage on Android phones

In today’s quick tutorial you will find out how to display a percentage sign on battery icon of your Android phone. This works in Android Marshmallow operating system, if you have different version of Android, you need to do some more research or look for some applications in Google Play.

Android phones display battery status in percentage but only when the phone is on charge. Many people prefer to see it all the time as this gives more information about the battery status than the bar icon.

Luckily we can very easily activate this option and there is no need to install any app to do so. Here’s how to do it.

Continue reading How to show the battery percentage on Android phones

Posted on

WordPress admin login, how to make it more secure

Today we will discuss security of WordPress site. I am not an expert on the topic but I know a few little tips how to make a WordPress site more secure and I want to share this knowledge.

The WordPress is the most popular platform on the web and because of that the security threat is real. I have four WordPress websites and recently implemented some measures to lower the risk of hacking.

The three bits of information needed to log on as an administrator and take over the control over WordPress site is url address of WordPress login page, admin name and password (of course it is also possible to hack via FTP or database).

I think we should guard these three vital pieces of information but in many cases the hacker may already know two out of three key elements.

Continue reading WordPress admin login, how to make it more secure

Posted on

How to switch on Night Light on Android phones

When you use your mobile phone, tablet or laptop with bright screen before going to bed, you may experience problems with falling asleep. The blue screen light looks similar to sun light and your brain ‘thinks’ that it’s the middle of the day. It keeps itself active preventing you to sleep.

One of the possible solutions is to use ‘Night Light’ or ‘Night Mode’ which is a ‘blue light filter’ making your display use warmer colours at night. It helps to reduce eye strain and can help you to sleep better.

Continue reading How to switch on Night Light on Android phones

Posted on

How to display text in paragraphs in Rails

A really quick post with some code allowing displaying text in paragraphs in Rails.

I am currently building a simple app for learning languages and yesterday I created for it a blog section with posts. There I want to write article about learning languages and each new line display as separate paragraph.

The following code does this trick. First you split the text into the array and then iterate over it and put each sentence into paragraph. Here’s the code:

Continue reading How to display text in paragraphs in Rails