How to change the image in the admin login page of WordPress like a pro!

We at Learn2Create recently thought of changing the logo on our admin page from the default WordPress Logo to our own. And, WE DIDN’T WANT TO USE A PLUGIN TO DO THAT!

Requirements:

  • Access to the CPanel
  • Basic knowledge about css and using broswer tools

Just like everyone I googled up “Change WordPress Logo on Admin login page” and tons of articles loaded up but, none of them were helpful. One article suggest that I insert a piece of code to override the settings or to use a plugin.

The official documentation by WordPress wasn’t clear about which file I had to edit.

Here’s how I did it, without overriding the settings or installing a plugin.

In pointers:

1. Open the wp-login.php file present in the root (public_html) of your WordPress installation.
File Path : root > wp-login.php

2. Open the external CSS file ‘login.min.css’  present in the css folder inside wp-admin folder.
File Path : root > wp-admin > css > login.min.css

3. Using Page Search feature on the browser CRTL+F search for '.png' in the CSS file. By default there will be two images - a .png and a .svg file. Remove the URL from the background style and replace it with the URL to your logo.

.login h1 a{
background-image:url(//yoursite.com/wp-content/uploads/2016/04/new_logo2.png);
background-image:none,url(//yoursite.com/wp-content/uploads/2016/04/new_logo2.png);
-webkit-background-size:200px;
background-size:200px;
background-position:center top;
background-repeat:no-repeat;
color:#444;
height:100px;
font-size:20px;
line-height:1.3em;
margin:0 auto 25px;
padding:0;
width:100%;
text-indent:-9999px;
outline:0;
display:block
}

 

4. Congratulations, you have successfully changed the image that loads up in your wordpress admin login page.

But, notice that the image still links to ‘wordpress.org’ and the alt text says ‘Powered by WordPress’. To change that, head back to the wp-login.php file and using Page Search feature (CRTL+F) search for ‘Powered by WordPress’; you’ll find two lines – the link and the alt text, change them both and you are good to go!

do_action( 'login_head' );

if ( is_multisite() ) {
 $login_header_url = network_home_url();
 $login_header_title = get_network()->site_name;
 } else {
 $login_header_url = __( 'https://yoursite.com/' );
 $login_header_title = __( 'YourSiteName' );
 }

 

NOTE :

  • If you do not have a ‘login.min.css’ file then edit the ‘login.css‘ file.
  • If the new logo that you added doesn’t fit then, set the width to 100% and change the background-size till it fits properly.

Hope this helps! 🙂

Check Out Other Beginner’s Articles on Learn2Create:

Run a program on Raspberry Pi using after closing SSH Connection
Programming an Arduino using a Raspberry Pi
A beginner’s guide to Programming
A beginner’s guide to Android Development
A beginner’s guide to Robotics

Let us know of any updates or edits on this matter in the comment section below. Learn to create with Learn2Create!

A Beginner’s Guide to Android Development

Let’s say you have a stunning idea for an application. You cannot wait to see everyone using it and just the idea of downloads, reviews and comments gets you excited. You’re ready to build the greatest app ever but there’s just one tiny problem: You don’t know where to start Android Development!

Learning to code is easy, it’s the mastery that takes intense practice and experience. Android development can be a bit more complicated. Not only do you need to understand Java, you also need to install all the Android-specific software and learn all of the unique features of Android app development.

In general, creating an Android app requires the SDK (Software Development Kit), an IDE (Integrated Development Environment) like Android Studio or Eclipse, the JDK (Java Software Development Kit) and a virtual device to test on.

Now we know that this may seem a little unnerving at first glance. Our objective is to provide you with a clear guide and to try and make your learning experience simple. And by the end of this article, you should have a basic app that you can start experimenting with. Here at Learn2Create, we will take the Android Studio approach.

You should grab a coffee first though, this may take a while!

Step 1: Download Android Studio

Before you get to that, first you need to install Java on your device. You will find the necessary documents and download links here.

Linux users can check official documentationInstructions to download and Install Java

To program in most languages, you need a piece of software called an IDE or ‘Integrated Development Environment’. The most common IDE for Android development is Android Studio, which comes direct from Google itself. You can get it here.

Android Development
Android Studio: The Official IDE for Android

What’s great about Android Studio is that it is designed specifically for Android development (unlike the second most popular option, Eclipse). This means that when you download the software, you’ll also get a lot of the other bits you need including the Android SDK and the Android Virtual Device, which is an emulator you can test your apps on.

Android Development
Eclipse is a great alternative to Android Studio

As mentioned, there are some alternatives to Android Studio. Eclipse is an older IDE that can be used for Android Development and developing other things too (such as iOS apps) and that is a bit more flexible overall. It’s also a much more fiddly to get started with though and not nearly as beginner-friendly.

Another great alternative for Android Development is Basic4Android. Basic4Android is an IDE that lets you code Android apps with the BASIC programming language. It simplifies many things and is mainly focused on ‘rapid development’. There are other options too, such as Unity3D and numerous app builders, each of which has specific strengths and weaknesses depending on what you’re planning on building.

Step 2: Set Up Android Studio for Android Development

Now that you have Android Studio installed, you are well on your way to Android Development. Before we begin, you need to install Java on your machine to use Android Studio. To be specific, you have to install the Java Development Kit (JDK). Java is the programming language you’re going to be using to build your apps in this instance and you need to install the JDK in order for Android Studio to be able to interpret and compile your code. You’ll find the JDK here. Just download and follow the instructions to install.

Click on Android Studio to begin. A menu with some configurations comes up and select as you wish.

There are three vital things interacting when you use Android Studio to create your apps.

  • Android Studio itself, which is an IDE that provides you with a nice interface for coding.
  • The code you write in Java, which you installed a moment ago…
  • And the Android SDK which you’ll access through your Java code in order to do Android-type things

 

Step 3: Starting a New Project

Once you’ve installed your samples, you can go back to the first page you saw when you loaded up Android Studio. Now you want to choose Start a new Android Studio Project – excited?

Enter the name you want for your application and your ‘company domain’. Together these elements will be used to create your package name with the following format:

com.companyname.appname

Android Development

Eventually, the package will be the APK (‘Android Package File’) that will be compiled. It is this APK that you will later upload to the Google Play Store. There are ways that people can see this, so if you’re planning on making something you’ll eventually release, try to avoid using weird words.

Also, enter the directory where you want to save all the files related to your app. Click Next and yay! More options! Don’t worry, we’re almost there… Next you need to decide what type of device you’re going to be developing for and in this case we’ll start with the Phone and Tablet option. Other options are TV, Wear and Glass.

Step 4: Almost there!

The other choice you have to make at this stage is the ‘Minimum SDK’. This is the lowest version of Android you want to support. Why not just enter the latest version of Android in here? The best bet at this stage is to go with the default option, so just leave this field as it is.

Android DevelopmentOn the next page, you’ll be given the option to pick the way you want your app to look at the start. This will be the look of your main ‘Activity Module’ which is basically the main page of your app. Think of these like templates; do you want to have the title of your app along the top of the screen, or do you want your UI to fill the whole display?

For your first creation, you’ll probably make something really simple that just displays a single, basic activity. Select ‘Basic Activity’ to keep things simple at the moment and for all practical purposes, this will now be your app. Click Next again you get the last options.

Now you get to pick the name for your activity and the layout name (if you chose ‘Basic Activity’ you’ll also have the title option and the ‘menu_resource’ name). The activity name is how you’ll refer to your activities in your code, so call it something logical like ‘MainActivity’. Can’t screw that up eh?

Lastly, choose a name for the menu and for the title. Pick something neat for the title, as your users will be able to see this at some point. Click next and finally you can see the app you created!

Basic Steps to start Android Development:

  • Download and install Android Studio, making sure to include the Android SDK
  • Install Java SDK
  • Start a new project and select the basic details

Just a reminder: When you’ve done all this once, you can forget about it forever and focus on the cool stuff: creating apps!

 

That’s it from us at Learn2Create! We will provide you with further reference links that we found to be great resources to learn Android Development. Adios!

YouTube Channel : Android Developers

Tutorials : Tutorials point

Official Documentation: Getting Started: Android Studio

Read More News on Learn2Create – News Category

 

Using raspberry pi without a monitor

Setting up a raspberry pi without monitor.

Raspberry pi is a low cost, credit card sized micro-controller cum computer, though slightly slower than the modern desktop and laptops, the raspberry pi works pretty good given it’s size.

This micro-controller cum PC was released with the intention of using it for educational purposes, to introduce children to programming. The flexibility and low pricing made it an instant hit amongst tinkerers, makers, and electronics enthusiasts for projects that require more than a basic micro-controller (such as Arduino).

Raspberry pi credit card sized
Fits in one’s palms

The Raspberry pi can be used like any other standard PC by connecting it to the computer peripherals like Keyboard, Mouse and Display(Monitor/TV via HDMI).

What if you don’t have a spare display or need to use RPi in embedded projects, for such scenarios the raspbian for RPi rolls out with pre-installed SSH and VNC server. Those who are unfamiliar with these terms SSH stands for Secure SHell and VNC for Virtual Network Computing. These services need to be manually turned on and requires a monitor for the initial setup.

Before heading any further, you’ll need to:-

i) Set up raspbian on raspberry pi. Follow this article for setting up raspberry pi.
ii) Connect the raspberry pi to your home network.

Steps to set up a headless raspberry pi

1) Turning on the SSH and VNC servers

  • Login to your RPi using your username and password. The default username and password are pi and raspberry respectively.
  • Start the terminal by hitting Crtl+T
  • Type in sudo raspi-config. This will open up the RPi configuration dialog.
  • Navigate to the SSH and VNC section, hit enter select enable or disable to enable/disable the SSH and VNC server.
    NOTE: SSH and VNC are different tabs and need to be enabled separately.
  • Restart!

2) Using SSH Server

  • Login to your raspberry pi
  • Start the terminal by hitting Crtl+T
  • In the terminal type the following line ssh [email protected]
    (By default it is [email protected])
  • If this doesn’t work then, you must find out the local IP assigned by your router
    (Follow the guidelines provided by your router to get the list of connected devices)
  • Once you successfully find out your IP address then, you will be prompted to enter your password. The default password is – raspberry.
    To reset your password you will need to access your raspberry pi using a monitor and type in the following command in the terminal – passwd pi
  • Follow these steps and you will be connected to your raspberry pi using the terminal
  • Additionally, you can set up X-forwarding to allow the use of graphical applications. You can do that by adding a -Y flag in the command ssh -Y [email protected]<IP>

3) Using a VNC Server

VNC, or “Virtual Network Computing”, is a connection system that allows you to use your keyboard and mouse to interact with a graphical desktop environment on a remote server.
VNC makes managing a remote server easier for users who are not yet comfortable with working with the command line.

To connect to your Raspberry pi using VNC you will need to:-

  • Install a VNC Client a.k.a VNC Viewer of your choice. I used RealVNC – which supports multiple OS and even browsers.
    (You need to follow the procedures for the Operating System of your choice)

    raspberry pi without monitor
    RealVNC provides VNC Viewer for multiple OS and even browsers
  • On your Raspberry pi (using a terminal window or via SSH) get the private IP address of your RPi by typing in ifconfig
  • Enter your Raspberry Pi’s private IP address into VNC Viewer:
    raspberry pi without monitor
    Enter the Private IP into the field

    Click on connect, if this doesn’t work. You have either:
    i) Not enabled VNC server
    OR
    ii) VNC server is listening to another port, in such cases you will need to find out the port at which VNC server is listening

  • Authenticate the VNC Server by entering in the Username and password of your Raspberry pi. Default:piandraspberry
  • To start serving remote desktop through VNC type in the following command in your terminal or via SSH vncserver. It will print out the IP and the port details of the server.
  • Enter this information into the VNC Viewer and you are good to go…

A remote connection is very useful when you are using the Raspberry pi in an embedded project or when you don’t have a display to spare..

Learn how to setup a Raspberry pi for the first time – Setting up a Raspberry pi.

Use the comment section below to let us know your suggestions and/or any queries regarding the topic – Using a raspberry pi without monitor.

A Beginner’s Guide to Programming

Beginners Guide Programming – A simplistic approach towards self-learning

One of the most frequent questions I get asked by my non-programmer friends is ‘How would you recommend a total beginner to start with programming’.

This is particularly a tough question because, we all are different and have different ways of learning. But I can tell you how I did it.

Disclaimer: I know I’m not the best programmer/coder there is, but I learned to code on my own. So, this is to all you guys who are interested in self-learning.

In this Beginners Guide Programming I will be trying to quickly clear a few misconceptions and introduce a some habits that can help you become an excellent programmer.

This technique is not confined for the art of coding, it serves as an excellent case study to learn any technical skill.

I won’t be talking much about any particular programming language here. Just the art of computer programming in whole.

I hope this will inspire a few to start coding; it’s a very interesting hobby and who knows it may one day earn you a living.

First things first:

Don’t Be Afraid of the Syntax

A major reason many people are scared off from trying to learn to code is well… the syntax. Syntax is the grammar for any programming language, there are a set of rules to how it is written. You don’t ask questions here, it is like that because of the way it is designed.

But that apart, the basic concept remains the same irrespective of the language. Syntax is just a way to express those ideas in the given programming language.

As an example, a commonly used concept in programming is a loop. A loop does exactly what it says; it loops through a set of instruction until a certain condition is met with. Once you understand how loops works and different types of loops then all that you need to do is google, “How do I use loop in <Insert your programming language here>” and you’ll get thousands of examples right away.

I personally think syntax are overrated. People whom I meet at work worry too much about trying out new languages, the reason? Syntax! And, this fear is being monetized by training center who do nothing more than teaching the syntax, I don’t think they even teach the basic concepts of programming. It’s just a waste of time and money.

Online courses at Codecademy are very good when it comes learning syntaxes and to some extend also helps in understanding the basic concepts.

Beginners Guide Programming
This image will help you understand the popular languages used in each of these fields

Start with a Tutorial Book

The best place to start is always with a careful walkthrough. For programming, I like O’Reilly or Balguruswamy

as a guide to learn the core concepts of any language.They are very well written keeping in mind all the different readers that may use them. There are no assumptions made at programming skills that you have, so a great way to start.

If you’re learning your first language, you may want to take an intro class on programming which can teach the basic concepts. Semantics are more important than syntax, so understanding the basic ideas is essential, while memorizing the exact spelling of a command usually isn’t (if you’re wrong, you’ll get an error and a quick Google search will inform you of your mistake).

Take up an online course

If you’re learning your first language then, taking an online course will help a lot.

Here’s some free courses which cover the basics:

The goal in the initial phase should be to get something working. Like, creating a basic hello world app will teach you all that you need to set up the environment. Once you get that started, it usually isn’t hard to modify these boiler plates to make something of your own.

As mentioned above, sites like Codecademy helps in learning the syntax and getting you started with a language.

Which Language Should You Start With?

There is no specific language that you should start with. Some say its:- C or C++, but I started with python, a much more abstract language which hides a lot of complexities from the user(programmer) and lets them focus on building the logic.

Beginners Guide Programming
Popular Programming languages with respect to the number of on-going projects.

For first languages, my personal suggestion is to  avoid C++ and C, because they tend to be a little less forgiving than Python and deal with a lot of code. I would also avoid web languages like PHP because they can be tricky to set up and require you to learn more at once (HTML, SQL).

The first language you should use, should be the one you want to use. So overrule my suggestions if you have something else is mind.

Learning by Project

This by far has been my best way to learn a new language. Create something(anything that interest you) could be something as trivial as ‘hello world’ or ‘a basic calculator’. Just make!

You can also download some done projects from the net and try to read through them. My friend used to always tell me ‘Break it to make it’, I feel the urge to tell you the same.

Fiddling around is the only way to truly learn.

The things to keep in mind when trying to learn by doing a project:-

  1. It should be short,
  2. It should force you to learn something new all the time,
  3. It should be fun!

 

Summarizing the post:-

  • Don’t fret too much about the syntax
  • Start with a tutorial book, learn the concepts
  • Take up an online course
  • Learn by doing projects

Programming has to be one of the best skills I’ve learned, not only because it’s fun and rewarding, but because it teaches a lot of life lessons as well. It taught me how to build things, organize projects and set goals for myself. And, as computers become more integrated into our lives, it’s nice to be able to communicate with them.

And, always remember ‘Break it to make it!’ 🙂

Let me know your views and suggestions on this article – The Beginners Guide Programming in the comment section below!

 

Check out the Code Category for code related articles in – Code Category.