How to remove www from your URL

There are some website owners do not want their URL have www. Like my site I don’t want to have a www in my URL. But there are some cases that Big companies have www in their URL like Facebook and Google This code will help you to remove it. Put this code in your […]

Add Trailing Slash in URLs

Some of the Search Engines remove the trailing slash from URLs. I know Yahoo does it, but it could result into duplicated content problems when the same page content is accessible under different URLs. Put the following code in your? htaccess. This code makes sure there’s a slash at the end of your URL.  

How to remove File Extension in URL

Sometimes we need to remove the File Extension in our URL like .php and .html for a different reason. For me my reason to remove is for security reasons. to do that go in your htaccess file and open it on your favorite text editor. mine is sublime text in this case will now […]

Centering a div tag of unknown width

Centering a div tag of unknown width

You can easily center a div by using margin: 0 auto; CSS property when you have its width in your CSS. But in case you wanted to center a div with unknown width you can use this code.  

How to check URL if something has that word

Learn PHP

There is a cases that we need to check our URL if there is a word we need on it. To search a URL in a specific word, Use this code. First the $_SERVER[‘REQUEST_URI’] will return the full path of the URL including the query string, in my case I put it on a variable […]

Equal horizontal elements

There is now a solution for the equal height when you want to create element in a horizontal position. Instead of using float:left; in your CSS we will only simply add the parent container the text-align:justified; property. and the child that will be in horizontal element will given a display:inline-block;     Happy Coding!

Make a word in Title Case format in php

Learn PHP

Making title case in PHP is very easy. First lets create a function that we can call every time we need the word to be Title Case or make the First letter in the word Uppercase. Now we will use the function we create.  

Create thumbnail size in WordPress

In WordPress we can add our very own thumbnail size we want so we can use in our customization. Add this code in your favorite functions.php. Using add_image_size function of WordPress. In my case I create a 285×148 size of thumbnail. The first option is the name of image that you can use to call […]

Removing auto p tag

Here is a code you can add in your functions.php in your WordPress template. This code will remove the auto adding of html “p” tag in your content.  

Page 5 of 6« First...23456