Get wordpress post content by post id

To get wordpress post content by post id use WordPress function get_post() with post id as parameter.

Using WP-CLI : A Command line interface for WordPress

WP-CLI – A command line interface for WordPress is a set of command-line tools for managing WordPress installations. You can update plugins, configure multisite installs and much more, without using a web browser. Setting up path for mysql command (For MAC OS Terminal) export PATH=$PATH:/Applications/MAMP/bin/apache2/bin/mysql Configure wp-config.php file at core WordPress wp core config --dbname=woo --dbuser=root --dbpass=root --dbhost= Start installation of WordPress for …

PHP show a number to decimal places

Use number_format() function to format number to decimal places.

Resync git repo with new gitignore file

After adding .gitignore file use following commands

Make sure to commit first your changes you want to keep. The –cached option will keep your files untouched on your disk though. Other more solution: git rm --cached `git ls-files -i --exclude-standard` Files with space in their paths In case you get an error message like fatal: path spec ‘…’ did not …

Creating Tabs with Bootstrap

Creating Tabs with Bootstrap CSS

Setting up new hostname with WordPress database

For setting up new hostname with WordPress database is required while moving site to new hostname. For this following SQL commands. In following example we are moving site with hostname to hostname