---
title: How to set the current version in wordpress custom dashboard
description: "1. Go to admin > appearance > theme editor > functions.php and look for this lines of code: ``` function wp_current_version() { global $wp_version; $v = substr($wp_version, 0, 6); return $v; } add_shortcode('current_version', 'wp_current_version'); ``` 2. Make sure this code…"
url: "https://www.lukehayes.com.au/kb/how-to-set-the-current-version-in-wordpress-custom-dashboard/"
updated: "2021-11-04"
category: PHP
---

# How to set the current version in wordpress custom dashboard

1. Go to admin > appearance > theme editor > functions.php and look for this lines of code:

```
function wp_current_version() {
	global $wp_version;
	$v = substr($wp_version, 0, 6);
	return $v;
}
add_shortcode('current_version', 'wp_current_version');
```

2. Make sure this code is available/added in the **functions.php** page. If not, add it at the bottom

3. Go to admin > plugins > plugin editor and select **Sweet Custom Dashboard**

![](https://www.lukehayes.com.au/wp-content/uploads/2021/11/image.png)

4. Click **custom-dashboard.php** and make sure this shortcode below is available/added. If not, add it next to the text.

![](https://www.lukehayes.com.au/wp-content/uploads/2021/11/image-1.png)

```
<?php echo do_shortcode('[current_version]');?>
```
