Create your own WordPress theme from scratch [Part 1]

Here is how to code your WordPress theme from scratch. If you have a HTML/CSS template ready and you want to turn it into fully functioning theme then you are at right place. You don’t need to be a very intelligent coder or a software engineer to code your own theme, all you need is little bit of time, patience and a bit of knowledge( which can be gained by just surfing for a few hours.).

Who is this tutorials for :

  • Those want to create a theme by themselves for WordPress.
  • Those who have basic knowledge of HTML, CSS and PHP.
  • Those who need help in coding.

Who isn’t it for:

  • Professional coders who is already knowing a lot about this and expecting better stuff here.
  • Those who wants to code a next-gen theme which is fully loaded, because this tutorials is for basic learners and only low level stuffs are taught here.

So lets get started…

Here is what are we gonna require first to get started.

  • Basic Template
  • CSS Styling

and we’re going to convert theme into theme.

 But….

As you know WordPress theme doesn’t have to be a single page code. We can break the main page into parts like.

  • Index.php . This page is the index page where we will include all the other blocks.
  • Sidebar.php This sidebar page, this will hold all the widgets and everything we want to include in side.
  • Header.php This is common page for all, it will handle all the heading, page linking, script linking and many things.
  • Footer.php this is also common, it will hold everything that you want to include at the bottom of page.
  • Content.php This is the page which will print the lists posts for the index.php
  • Single.php this is the page which will open when you click to open a single article.
  • Comments.php , this page will show the comments.
  • Search.php This is the page which will show the search results.
  • searchform.php this the page which holds your custom search for( it is not really necessary as there is already a built in search form).
  • Tags.php this will show the lists of posts tagged under same tags.

So, understand them. Now we must break our custom theme into parts and start coding.

NEXT PART:
CREATE YOUR OWN WORDPRESS THEME FROM SCRATCH [PART 2]

Android apps you may not be knowing even existed [Part-1].

Here few apps I find useful and very helpful in certain situations. I hope they are of some use to you too.

QuickPic

Are you bored of you stock gallery? then probably you should get an alternate to it.

https://play.google.com/store/apps/details?id=com.alensw.PicFolder&hl=en

It has many inbuilt functions which aren’t available in the default gallery, this is what it makes a must have gallery app.

App Backup and Restore

This is another great app, if you want to switch the phone or temporarily remove any app then you will find this app of great use, you can back up your files in apk format and install it any other devices. Perhaps, you can also backup the apks and preserve them on your computer.

https://play.google.com/store/apps/details?id=mobi.infolife.appbackup&hl=en

Truecaller

Truecaller is an app that is great for everybody, It is just like an universal phone directory. It has a huge database of contacts from many different countries. So, you will always get the name before pickup the phone, even the unknown country. Got to try this by yourselves.

https://play.google.com/store/apps/details?id=com.truecaller&hl=en

Fake-A-Call

This is totally a fun app, you can set the calls to ring yourself like an alarm. Caught up in useless talks? want to get out from there? then ring yourself. This is just a great app to fool people.

https://play.google.com/store/apps/details?id=net.excelltech.fakeacallfree2&hl=en

Music Off- Music Timer

Do you like to listen to music while you are in bed? then this is best tools for you, it turns off the music as soon as you fall asleep, automatically. It is really a smart app. Try it.

https://play.google.com/store/apps/details?id=asia.utopia.musicoff&hl=en

[How to] Store and Display images from MySQL using PHP

Now everything is database driven and people are willing to involve the db technology everywhere. So, lets see what we can do to throw a image on the screen not directly from the directory, where it is stored as it is. But, we will see how we can store the image in DB and display images from db.

As we are going to do it, I want to tell you what are the procedures involved in it.

First, we will read the images in the binary mode(Binary mode because it can represent anything) using a PHP script, and all the binary code will be stored in the database as is.

Next, we will give the name or number to those data for the identification.

And at last, we will create a script which will access the db, read the data into it, and display image.

Sounds simple isn’t it? Here create a table named imagedb

Now lets create a page called ” store.php ” because it the page we will use to read the images, and store it in DB.

The code we will add to it are

Save the file, and now create a new file called “images.php” and add this code below. this is the page which will fetch us image from the DB.

$data = $sth->fetchAll();
echo $data;

Now type the url http://localhost/path/to/image.php?id=id_u_used , tadaaa, you can see the image.

if you want to put your images somewhere, just use

<img src=”image.php?id=image_id” />