Showing posts with label blogger. Show all posts
Showing posts with label blogger. Show all posts

Monday, May 16, 2016

Get Logged In user ID in WordPress

To get the currently logged in user ID in WordPress use the following code.

<?php
$current_user_id = get_current_user_id();

echo $current_user_id;
?>


$current_user_id will give you the ID of the currently logged in user.

Update Wordpress without FTP

Sometimes when WordPress site is updated ftp details are asked while updating. We can surpass the FTP authentication and directly update WordPress, Plugins and Themes to latest version.
To do so open your wp-config.php file (file is present on the root of wordpress installation).

After opening the file in an editor find the following line

require_once(ABSPATH . 'wp-settings.php');


After you find the above line in the wp-config.php file place the following line below it.

define('FS_METHOD','direct');


So, your final file should look like below.

require_once(ABSPATH . 'wp-settings.php');
define('FS_METHOD','direct');


After this save you wp-config.php file and upload back to server. Now WordPress, Plugins, Themes can be updated to their latest version without the need to enter FTP details.

Wednesday, December 23, 2015

Wordpress home url

As we know WordPress is a very powerful blogging open source CMS, so is development easy and flexible.

To get the home page URL use the following function.

$home_url = home_url();

<?php echo $home_url; ?>

You will get the home URL in the above variable.

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...