|
|
How to display an incrementing number next to each published post The first thing to do is to paste the function into your functions.php file: function updateNumbers() { global $wpdb; $querystr = "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'post' "; $pageposts = $wpdb->get_results($querystr, OBJECT); $counts =… |
|
|
10+ regular expressions for efficient web development Validate an URLIs a particular url valid? The following regexp will let you know./^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \?=.-]*)*\/?$/Source: http://snipplr.com/view/19502/validate-a-url/Validate US phone numberThis regexp will verify that a US phone number is valid./^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/Source: http://snippets.dzone.com/posts/show/597Test if a password is strongWeak passwords… |
|
|
Automatically replace content in PRE tags by HTML Entities Just paste the following in your functions.php file. Once saved, all your content with <preand </pretags will be automatically replaced by html entities. function pre_entities($matches) { return str_replace($matches[1],htmlentities($matches[1]),$matches[0]); } //to html entities; assume content is in the "content"… |
|
|
WordPress hack: Show your top contributors without a plugin Simply paste this code where you want your top contributors to be displayed. Note that this code use the mysql_* functions instead of the $wpdb object. This is not the better way to do this, but it do the trick… |
|
|
10 examples of futuristic CSS3 techniques Pure CSS speech bubblesIn a design, bubbles can be great to illustrate a quote. In this article, talented designer Nicolas Gallagher will show you what he built with CSS3: Text bubbles, with no Javascript or images. Source: http://nicolasgallagher.com/demo/pure-css-speech-bubbles/bubbles.htmlSuper Awesome… |
|
|
WordPress tip: allow upload of more file types Simply paste the following code on your functions.php file. If needed, you can add more file types by adding them on line 4, separated by a pipe (|) <?php function addUploadMimes($mimes) { $mimes = array_merge($mimes, array( 'tmbundle|tmCommand|tmDragCommand|tmSnippet|tmLanguage|tmPreferences' => 'application/octet-stream' ));… |
|
|
Top 10 best practices for front-end web developers Explain which div you’re closingMost of the time when I’m viewing a website source, I see, at the very bottom of the page, an almost endless list of closing </div> tags. In fact, many beginners think they just have to… |
|
|
WordPress tip: Get rid of unused shortcodes Simply run the following SQL query on your WordPress database, using the command line client or PhpMyAdmin. In this example, I assume the unused shortcode is [tweet]. Don't forget to backup your database before using this query. UPDATE wp_post… |
|
|
WordPress tip: Get rid of unused post revisions Just run the following query on your WordPress database, and all revisions (As well as meta associated with it) will be deleted from your database. Of course, do not forget to make a backup of your database before running the… |
|
|
10 sql tips to speed up your database Design your database with cautionThis first tip may seems obvious, but the fact is that most database problems come from badly-designed table structure. For example, I have seen people storing information such as client info and payment info in the… |
|
|
WordPress plugin: Protect your blog from malicious URL Requests Paste the following code into a text file, and save it as blockbadqueries.php. Once done, upload it to your wp-content/plugins directory and activate it like any other plugins. That's all! <?php /* Plugin Name: Block Bad Queries Plugin URI: http://perishablepress.com/press/2009/12/22/protect-wordpress-against-malicious-url-requests/… |
|
|
WordPress tip: Create a PDF viewer shortcode The first step is to paste the following code into your functions.php file: function pdflink($attr, $content) { return '<a class="pdf" href="http://docs.google.com/viewer?url=' . $attr['href'] . '">'.$content.'</a>'; } add_shortcode('pdf', 'pdflink'); Once you saved the file, you'll be able to use the shortcode… |
|
|
10+ useful code snippets to develop iPhone friendly websites Detect iPhones and iPods using JavascriptWhen developing for the iPhone and the iPod Touch, the first thing we have to do is obviously detect it, so we can apply specific code or styles to it. The following code snippets will… |
|
|
WordPress trick: Change theme programatically The first thing you have to do is to paste the following function in your functions.php file. function switchTheme($theme) { global $wpdb; if (isset($theme)) { $queries = array("UPDATE wp_options SET option_value = 'default' WHERE option_name = 'template';", "UPDATE wp_options SET… |
|
|
WordPress : 10+ life saving SQL queries How to execute SQL queriesFor those who don’t know yet, SQL queries have to be executed within the MySQL command line interpreter or a web interface such as the popular PhpMyAdmin. Since we’re going to work on WordPress, you should… |
|
|
How to display custom post types on your WordPress blog homepage The following code have to be pasted in your functions.php file. Once the file will be saved, it will work. As you can see in the code, the post, page, album, movie, quote, and attachment… |
|
|
10+ useful online code editors Amy EditorCreated in 2007 by Petr Krontorád, Amy Editor is an advanced editor with a look and feel of a Mac. Amy Editor features lots of useful options, such as line numbers, syntax highlighting, snippets for more than 20 languages,… |
10,705
Empowering, Informing, Connecting Creative Professionals™
The Workflow Network is a collection of Websites, services, and communities built to Empower, Inform, and Connect Creative Professionals. The websites in the Network cover a broad range of topics, services, and functions for creative professionals of many disciplines.
|
© Copyright 2008–2012 Pariah S. Burke Article contents and photographs © Copyright their respective publishers. Workflow: WordPress runs a highly modified version of the Gadgetine WordPress theme by orange-themes.com. Website thumbnails provided by BitPixels.
Terms of Use | Privacy Policy Workflow: WordPress is a part of the Workflow: Network. Get Empowered, Get Informed, Get Connected™ |
Connect with Workflow: WordPress |
|