Web & Software Developer

Page 31 - Code Snippets and Tutorials

Display All Files in a Directory With PHP

This is raw php code that will dynamically generate a list of all files in a directory so that you can view this list online. This is useful if you have a website with a random private directory in which you like to store private files. Before using this code, you should have some type … Read more →

Display The Current Date on Your Website With JavaScript

If you want to display the current date on your website, use this script. Since it’s JavaScript, a browser-side language, the date will always be current according to the viewer’s time, anywhere in the world. This code takes the current date from the user’s computer, not from your server. (This is one of the times … Read more →

How To Add Placeholder Text Inside Any Search Box

So you want to add text inside your boring, old search form (a.k.a. search box). This javacsript will let you add a few words inside the search form. Those words are called “placeholder text.” The words will appear in the input field of the search form. When the input field of the search form is … Read more →

Change the Length of the Excerpt in WordPress

Here is the easiest and quickest way to change the length of the excerpt without a plugin in WordPress. The post excerpt is normally 55 words long. You change this by pasting some lines of code into the functions.php file of your WordPress theme. Take the following code: Make the following changes: on line 2, … Read more →