Create Custom Post Type with category
A custom post type can be added to WordPress via the register_post_type() function. This function allows you to define a new post type by its labels, supported features, availability and other...
View ArticleIE10 CSS Hacks
@media -ms-high-contrast Hack This one comes from a gist by German developer Alex Kloss. It takes advantage of two things: 1) The fact that IE10 supports media queries; and 2) The fact that IE10...
View ArticleAdaptive Images
Adaptive Images detects your visitor’s screen size and automatically creates, caches, and delivers device appropriate re-scaled versions of your web page’s embeded HTML images. No mark-up changes...
View ArticlePHP – technical definition
(PHP Hypertext Preprocessor) A scripting language used to create dynamic Web pages. With syntax from C, Java and Perl, PHP code is embedded within HTML pages for server side execution. It is commonly...
View ArticleMySQL – technical definition
A very popular open source, relational DBMS for both Web and embedded applications from MySQL AB, Uppsala, Sweden (www.mysql.com), which was acquired by Sun in 2008. Pronounced “my S-Q-L,” it runs...
View ArticleMoving WordPress Site
There are times when you need to move WordPress around within your server, and times when you need to move WordPress from one server to another. You don’t need to reinstall. WordPress is flexible...
View ArticleImporting Database in MySQL from a sql dump file
First create a dump or .sql file of the database you want to take back up of. Then transfer it to the computer on which you want to import the data (if the file is not on that computer). Now follow...
View Article* { Box-sizing: Border-box } FTW
One of least favorite parts about layout with CSS is the relationship of width and padding. You’re busy defining widths to match your grid or general column proportions, then down the line you start to...
View ArticleWhy a BorderContainer may not be displaying
The most common culprit when your suhas/layout/BorderContainer doesn’t display at all is forgetting to set the width and height of the html and body elements. Somewhat counter-intuitively, these...
View ArticleIs PHP the New Java?
A look at this increasingly popular coding language and whether small businesses should be using it for Web development. Fast and cheap, the programming language PHP has won small business converts in...
View ArticleWP – I’ve been hacked. What do I do now?
The Exploit Scanner plugin can help detect damage so that it can be cleaned up. Other things you should do: Change passwords for all users, especially Administrators and Editors. If you upload files to...
View ArticleHow do you get cruft free URIs for search results?
To return clean URIs for search results in WordPress from the search form (www.example.com/search/searchterms instead of http://www.example.com/?s=searchterms) First create a file called search.php...
View ArticleAppend content outside of loops – jQuery
//BAD $.each(myArray, function(index, item) { var newTweet = '<li>' + item + '</li>'; $('#statuses').append(newTweet); }); //GOOD var newTweet = ''; $.each(myArray, function(index, item) {...
View ArticleBest Practices: Avoid Anonymous Functions
Anonymous functions are often used when binding event handlers. However, anonymous functions are difficult to debug, maintain, test, or reuse. It’s better to use object literals: //BAD...
View ArticleBest Practices: Optimizing Selectors
Here are some tips to keep in mind when using selectors: Id selections are really fast. They are handled by document.getElementById() // This is fast $('#statuses .status'); //This is faster...
View ArticleHow to Protect a Website From Malware
Owning and designing websites is an exciting experience. The technology allows web designers to create interesting and dynamic websites. However, every website owner knows that security of her website...
View ArticleJavaScript Closures
What is a closure? A closure is an inner function that has access to the outer (enclosing) function’s variables—scope chain. The closure has three scope chains: it has access to its own scope...
View ArticleBasic PHP File Handling
Create a File $my_file = 'file.txt'; $handle = fopen($my_file, 'w') or die('Cannot open file: '.$my_file); //implicitly creates file Open a File $my_file = 'file.txt'; $handle = fopen($my_file, 'w') or...
View ArticleGet Last four week (start and end date)
get current date $custom_date = strtotime( date('Y-m-d') ); Last week date on Monday and Sunday. $week_start1 = date('Ymd', strtotime('last week last monday', $custom_date)); $week_end1 = date('Ymd',...
View ArticleFile/folder Permission
Note that mode is not automatically assumed to be an octal value, so strings (such as “g+w”) will not work properly. To ensure the expected operation, you need to prefix mode with a zero (0):...
View Article