-
Let’s build WordPress theme – part 3
OK, boys and girls, we are here with the third part of our tutorial. How to build WordPress theme. Well, as we can see in our previous parts (part 1, part 2), it’s more than easy. Of course today we’ll get deeper. New player Our new player is functions.php file. Let’s create it in root theme folder (beside style.css and index.php). This file is very special for WordPress theme development, because it is always fired, before the rest of the theme. This file is optional, but it is very important for us. Here we will do all WordPress magic. At this point, the content of functions.php will be very small. This will…
-
Let’s build WordPress theme – part 2
All right now, as you may remember in previous part we have already built WordPress theme but at this point, it is completely terrible and useless. However, we can see posts and this is it. Today we will do a little more. Let’s start. HTML Declaration We will use HTML5, so we leave Doc Type declaration as it is. But we have to take care about browsers (especially older versions of Internet Explorer) and we need to set proper language attribute. Because we do not know which WordPress language version will be used by the user, we need to use language_attributes() function. Then we have to use some conditional comments…
-
Let’s build WordPress theme – part 1
Booyah, we will do it! We will create sample WordPress theme from a scratch. It will be object oriented, clean code… I hope! Anyhow, we will learn a lot in this course. All right, let’s do it. WordPress setup This is the easiest part. If you want to write a theme, you must know how to install WordPress instance. You can do it on remote server, on your local machine – it is up to you. Just make it clean installation – we do not need any 3rd party to interfere with our project. Theme directory As you may know, theme directory for WordPress is /wp-content/themes/ and we will work…
-
How to add and use CSS files in WordPress
It is very easy. If you want to use CSS files in your own Word Press theme, let’s start with style.css. This file is required when building WP theme and it must be put in root directory of the theme. Why it is so important? At style.css you must put at least name of the theme. You can also add authors info, license info etc. You can also add another CSS files here! So, if you have style.css file, you can use: @Import directive You can use @Import directive in style.css to include your own CSS files. It is pretty simple (one thing you must remember – it is using…
-
How to add WordPress Administrator using PHP
Sometimes you are catch in this situation: client just sent you FTP access to the site but no WordPress password/user info at all. What to do? Since you have FTP access, you can do anything you’ll like and I will show you how to do that. First of all, login to the site via FTP and find index.php file in the root directory of the WordPress installation. Go to the very end of the file and write down something like this: [crayon-672b5f5042fd3088612610/] Now, simply run this site, by entering its url in the browser. Be sure to remove those lines after that! Now you can get into /wp-admin and login…