• Wordpress

How to dynamically switch themes in WordPress

Here is how you can dynamically switch themes based on your criteria inside "switch_theme_by_browser" function. For this example I used browser conditions to switch between themes. This feature works best by creating a plugin. Just create a new folder (call it whatever you want) in your plugins folder. Create an index.php file and paste the code below. Install and active ....read more

  • Ajax

Ajax Cross Browser Communication

The client (browser) can make calls to a different domain then what it currently resides on but this does not necessarily mean that the requested server will accept the request(s). With slight modification on the server this communication can be achieved. For this example I will use PHP as an example but the implementation concept holds true irrespective to the ....read more

  • 404 Error

WordPress Custom Post Type 404 Error

Custom Post Types are a wonderful feature in Wordpress and a great mechanism for customization. When implementing this feature you may come across a scenario where you encounter a 404 error when reviewing your custom post type on the browser. The easiest solution that worked for me is the use of the flush_rewrite_rules() function. Just add this function to your ....read more

  • Wordpress Paganation

WordPress Custom Post Type Pagination

Setting up pagination for your custom post type can be easily done on Wordpress. I recently came across a situation where I had to output a list of posts for a custom posts types on a Wordpress page. The following code snippet example will output a list of posts based on your custom post type ($my_custom_post_type). $my_custom_post_type = "some_custom_post"; $loop ....read more

  • wordpress permalink url

WordPress Unable To Change Permalink URL

I recently was working on a custom page that required a unique URL. That's pretty easy to do on Wordpress right? Just create a new Page and click on the "Edit" button to change the URL. I started to scratch my head (more then once) when Wordpress would not allow me to edit the URL to the URL that I ....read more

  • Edit Mac Host File

Edit Mac Host File

If you need to add or edit an entry to your Mac host file then open your terminal/console enter the following command: sudo vim /private/etc/hosts After editing your host file you should clear your host cache. Enter the following command to clear your cache: dscacheutil -flushcache