PHP Tutorials

  • By
    Remove Plugin Stylesheets and Scripts in WordPress

    Many WordPress plugins implicitly inject stylesheets and JavaScript files into the page on each page load.  If you don't plan on custom-styling for elements created by the plugin, that's no problem...but you can get caught in a CSS specificity battle if you do intend custom styling.

  • By
    WordPress AJAX Comments

    There are many functionalities on the web that were just begging to be AJAXified.  Whether it be voting on a poll or simply commenting on a blog post, there's really no reason to reload an entire page for something so simple.  This blog has featured AJAX...

  • By
    Prevent Posts in a Category From Displaying in WordPress’ RSS Feed

    I recently posted a snippet which prevented posts in a given category from displaying in WordPress' main loop.  I even went on to create my first WordPress plugin to accomplish the task via the WordPress control panel.  The one task those snippets doesn't complete...

  • By
    Create a “Recent Posts” Module Outside of WordPress

    I've never created a complete client website using WordPress, but many of those websites do have a WordPress blog to compliment the website. Oftentimes the client will want to list recent blog posts within the website, not within the WordPress shell. No problem --...

  • By
    WordPress Plugin:  Remove Posts in Category From Homepage

    Being a WordPress user for some time, I've always wanted to create a WordPress plugin but I've hesitated.  I've not run into an issue that I couldn't find an existing plugin for, and the thought of maintenance on a WordPress plugin seemed daunting because...

  • By
    Prevent Posts in a Category From Displaying in WordPress’ Loop

    This code snippet has become a WordPress plugin! Categories are obviously a major "classification" utility for websites and blogs that use WordPress.  Sometimes you want a category to represent more than just a basic post subject classification -- you may want a category of your blog...

  • By
    Disable WordPress autop

    Back when I first started this blog, and in turn using WordPress, the most annoying part of blogging was WordPress' auto-formatting.  WordPress would strip out custom attributes, mess with my DIV and paragraph structure, and just generally raise havoc.  It bugged me so much that since...

  • By
    Prevent Robot Indexing with Response Headers

    Every so often you have parts of your website that would be better off not indexed by search engines.  API calls, search result pages, PDF documents -- all examples of responses which may not have value outside of the current user.  No we all know we...

  • By
    Promote MDN WordPress Plugin

    I'm very happy to share with you the Promote MDN WordPress plugin, created by Mozilla Web Developer Luke Crouch.  The Promote MDN plugin analyzes your blog post content and links prominent development keywords to the Mozilla Developer Network.  MDN is...

  • By
    User Agent Parsing with PHP, JavaScript, or Python

    Saying the phrase "user agent" or "user agent string" is tantamount to saying a swear word. Developers used to use the user agent to detect if a browser had a given feature, instead of, you know, checking to see if the feature actually existed via...