When we create a child theme from the main theme we have chosen to build our website under WordPress, we normally only need three files:

  1. screenshot.jpg: this is a 600×450 pixel JPG image that will be the image of our child theme. At APG we always use our own logo in our customisations, so you can put whichever image you like best.
  2. functions.php: we have talked about this file countless times and it is the one that lets us add customised PHP code.
  3. style.css: this is the stylesheet where we put the customised CSS code we need to build the website.

Problem

Specifically, the problem we are facing today will show us our website with no stylesheet, practically the same as the way the Google spider sees it, so it will only show text and images with no layout of any kind.

This problem occurs in some themes in which the standard way of loading the parent theme’s stylesheet does not work.

We remind you that the usual way of loading the parent theme’s stylesheet is to add a simple line of code in the style.css file of the child theme, specifically one like this:

Copy to clipboard

Solution

Well then, to solve this problem, which can give us more than one headache, the solution is really simple.

To do it we are going to disregard the previous code, since it is not going to produce any kind of positive result, and we are going to create a new PHP function in the functions.php file of the child theme, specifically this one:

Copy to clipboard

Thanks to this simple PHP function we will have solved the problem and we will see our website again just as we expected, well laid out and structured.

We hope this small piece of code gets you out of more than one tight spot and that you find it useful.

Related posts

Comments

Suscríbete
Notificar de
0 Comments
Más antiguos
Más recientes Más votados

In this post

Products and services

Latest posts

Latest comments

Subscribe!

Lista de correos de APG

DATA PROTECTION: In accordance with data protection regulations, we provide you with the following processing information: (+)

  • Responsible: Art Project Group.
  • Treatment purposes: to respond to queries or any type of request made by the user through any of the forms of contact that are made available on the website. Sending communications about products or services (with your consent).
  • Your rights: access, rectification, portability, deletion, limitation and opposition. More information about the treatment in the Privacy Policy.

What we post on !

Se ha publicado #WooCommerce 11.2.2: actualización de seguridad que refuerza las API REST y Store, mejora la validación de CSV y corrige problemas en pagos y pedidos. Incluye cambios en la base de datos.

¡Actualiza cuanto antes!

November 5, 2026