Written by Mike PaynePosted in Blog,Development,Snippet,WordpressTags: Development, hack, PHP, publish, Snippets, user roles, WordPressSeptember 29, 2011
A common issue many beginner WordPress users run into is blocking certain content from users that aren’t registered or logged in. Here is a short, simple solution in the form of a shortcode.
Read more
Written by Mike PaynePosted in Blog,Development,Snippet,WordpressTags: cmd+s, ctrl+s, Development, hack, javascript, jquery, page, PHP, post, publish, shortkey, Snippets, WordPressAugust 16, 2011
I spend a lot of time coding. a lot. So much so, that when I write posts and pages on my WordPress sites and go to save it, I hit Ctrl+S (Cmd+S on Mac), which is the short-key to save in pretty much any program ever made. It can get frustrating to save and have to stop, exit out of the popup window trying to save the website locally, and then hit the Update button. So, this snippet covers how to detect when a page is loaded, output scripts, see when a user presses multiple buttons across operating systems, stop the default reaction from the browser, and finally activate a button.
Read more
Written by Mike PaynePosted in Blog,Development,Snippet,WordpressTags: comments, Development, hack, PHP, Snippets, spam, WordPressJuly 29, 2011
Web browsers store a lot of information about how you navigate the internet, and one of those metrics is called a referrer. A referrer is the page that you were on before the page you are currently on. By checking this browser option we can eliminate quite a few of our spammy comments from bots that crawl the internet and post links to certain ‘medical solutions’. Bellow is another WordPress PHP Snippet that you can post into your functions.php and will check whether a referrer exists or not.
Read more
For some reason, a popular way to remove the /{category}/ base from the Wordpress url in the past has been to edit the URL before it is shown in the browser by perform a .htaccess hack. This can cause a lot of issues, not to mention, you would need to add a similar line for every category you would want to cloak. Luckily, Wordpress has added an apparently little known dashboard option to edit this.
Read more
Written by Mike PaynePosted in Blog,Development,Snippet,WordpressTags: Contact Info, Development, hack, PHP, Snippets, User Profiles, WordPressJuly 19, 2011
Wordpress has been around for a few years now, and a lot can change in just a few years. Especially when the internet is involved. The User Profiles functionality was developed in it’s early days, and the contact info fields were relevant ways to contact users..then. Yahoo IM, AIM, and Jabber..? No one uses those!
Read more