Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

222
Vistas
How to detect wordpress theme using php

i have look for Wordpress theme detector but i have no idea how it works and how to detect wordpress activated theme into theme folder. like https://theseotools.net/wp-theme-detector

please help me how can i did this.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I wrote this code for the purpose of readability. Normally, people would spend more than 10 lines of code fetching the name of an active wordpress template. There might be some minor adaptions needed, but nevertheless, this works. So, first we fetch the source code for the home page. Then we use regex to find style.css, then we use regex to fetch the name (refer to wordpress style sheet conventions), and yay we now have the name of the active theme. You can even get the download URI from here, as well.

<?php
$targetSite = ""; // put your wordpress url here
$src = file_get_contents($targetSite);
preg_match("/\<link rel='stylesheet'.*href='(.*?style\.css.*?)'.*\>/i",$src,$matches);
$styleHref = trim($matches[1]);
$styleSrc = file_get_contents($styleHref);
preg_match("/\Theme Name:(.*?)\n/i",$styleSrc,$name);
echo(trim($name[1]));
?>
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda