Slick Carousal in RTL Mode

carousel-night-hero-image

img_0448I have been scratching my head all night to get this thing fixed! We have been using Slick Carousal in one of our projects and it breaks whenever ‘dir=”rtl” is injected into the body tag.

I wish I had came across this before because it costed me a good night sleep and 2 cups of coffee to make it work in the arabic version of the website.

The solution was plain simple, you basically have to use the following option when initializing the carousal:

$('.single-item-rtl').slick({ 

rtl: true 

});

Source: http://kenwheeler.github.io/slick/

 

Why WordPress doesn’t detect custom post type templates?

wptemplate

I made a custom post type with the machine name special_media_post and wordpress was simply not seeing the single-special_media_post.php. I was at a complete lost. It kept defaulting to the index.php until I tried the following solution:

Visited the permalinks page (which will flush it) and checked again. WordPress probably just needs to be nudged to recognize your addition to the hierarchy.

 

Source: http://wordpress.stackexchange.com/questions/96785/custom-post-type-single-custom-php-not-working

WordPress admin bar not showing on front end for custom theme

how_to_seo_wordpress

Some custom wordpress theme doesn’t show the admin bar into the theme page same with the wp_head() and the wp_footer() wrote on the templates files. To resolve that problem just add the following code into your function.php or into your own plugin:

function admin_bar(){

  if(is_user_logged_in()){
    add_filter( 'show_admin_bar', '__return_true' , 1000 );
  }
}
add_action('init', 'admin_bar' );

Source: http://stackoverflow.com/questions/21277190/wordpress-admin-bar-not-showing-on-frontend

Creating a Bootable Ubuntu USB Drive, for PC, on a Mac

ws_apple_ubuntu_colors_1920x1200

Tried UNetbootin but didn’t work out! Command Line saved the day yet one more time.

Steps:

  • Download Ubuntu ISO
  • Convert the Downloaded File Format
    hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso
  • Determine the Device Node for the USB Drive
    diskutil list
  • Unmount the USB
    diskutil unmountDisk /dev/diskN
  • Create the Bootable USB Drive
    sudo dd if=/path/to/ubuntu-14.04-desktop-i386.dmg of=/dev/rdiskN bs=1m
  • Prepare to Remove the USB Drive
    diskutil eject /dev/diskN

Regarding the dialogue box, click Ignore to get rid of it.

How to fix PHP.INI that is not updating in an apache mac setup

php-style-006

If you issue the following command in terminal:

php --i | grep ini

This will show you the loaded pho configuration file. My output was this:

Loaded Configuration File:         /usr/local/etc/php/5.6/php.ini

But when I upgraded my MacOS from El Capitan to Sierra, updating the above file didn’t reflect any change on my development websites. WordPress was still showing 2 MB even though I was using the following:

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

After googling here and there, I found a solution. Thanks to Gergely on stackoverflow here.

First use phpinfo to find out the current loaded file.

You would see:

Loaded Configuration File  None

now open your terminal:

cp /etc/php.in.default /etc/php.ini

Thats it. Make any change to the newly copied file and it would update in the webserver without any issues 🙂