How to Easily Identify the WordPress Theme a Site is Using

Home » Snippets » How to Easily Identify the WordPress Theme a Site is Using
0

Created with:

Visibility: 

public

Creator: WPTurbo Team

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project

Have you ever come across a website and wondered what WordPress theme they are using? Maybe you stumbled upon a beautifully designed website and you want to use a similar theme for your own site. In this article, we will discuss different methods to find out what WordPress theme a website is using, whether it’s through the use of browser extensions or online tools. So, let’s dive into how to see what WordPress theme a site is using.

					function wpturbo_get_current_theme() {
    $theme = wp_get_theme();
    echo "<p class='wpturbo-current-theme'>" . sprintf( __( 'This site is currently using the %s theme.', 'wpturbo' ), $theme->get( 'Name' ) ) . "</p>";
}
add_action( 'wp_footer', 'wpturbo_get_current_theme' );
				

The code snippet above is a simple WordPress function that adds a paragraph at the bottom of the site that displays the name of the currently active WordPress theme.

The first line of code defines a new function called wpturbo_get_current_theme(). Inside this function, we call the wp_get_theme() function to retrieve the active WordPress theme.

$theme = wp_get_theme();

After we have the active theme, we use the echo statement to output a paragraph that displays the name of the active theme.

echo "<p class='wpturbo-current-theme'>" . sprintf( __( 'This site is currently using the %s theme.', 'wpturbo' ), $theme->get( 'Name' ) ) . "</p>";

We use sprintf() to include the name of the active theme inside the paragraph. The __() function makes the text of the message translatable, which is useful if the website is used by people who speak different languages.

Finally, we hook the wpturbo_get_current_theme() function into the wp_footer action. This ensures that the paragraph with the active theme name is printed at the bottom of the site after all other content has been displayed.

Once you load the website, you will see the message with the name of the active WordPress theme at the bottom of the page.

Register an account to save your snippets or go Pro to get more features.