Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Wordpress site show css that doesn't exist anywhere

I have a work-in-process project http://viktoria.fi/sitedata/

The page title is Viktoria Nikkari and description is Taiteilija & Opettaja

Why the server is reading that the site description has 33px left margin. I swear that .site-description { margin-left: 33px; } line is nowhere in my code. Still all (Chrome and Firefox) developer tools show that this .site-description line is active in http://viktoria.fi/sitedata/wp-content/themes/canvas-child/style.css?ver=5.8.0 and http://viktoria.fi/sitedata/wp-content/themes/canvas-child/style.css?ver=4.1.1 These files DO NOT exist! I don't know what is this sorcery that is haunting me.

I have cleared my database tables = NO HELP and made fresh wordpress installation with new databases and user = also NO HELP.

The child theme's style.css file only has

/*
 Theme Name:   Canvas Child
 Theme URI:    http://viktoria.fi/
 Description:  Viktoria.fi Canvas Child Theme
 Author:       Konstantin Nikkari 
 Author URI:   http://raccoonbox.com
 Template:     canvas 
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         canvas, woothemes
 Text Domain:  canvas-child
*/

The child themes's functions.php file only has

<?php

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') );
}
?>

Also. When I'm editing my child theme (canvas-child) in appearance - editor what ever I type there, even body { background-color: orange; } nothing changes in the site.

Please help me. I have lost full day on this problem and I don't know what is the problem.

1 Answer

Lewis Cowles
Lewis Cowles
74,902 Points

These CSS definitely has that code at the bottom of the CSS file output, but not at the bottom of http://viktoria.fi/sitedata/wp-content/themes/canvas-child/style.css (it is very small file for checking...).

What you could do

  • Turn off any caching & clear caches
  • Append a style tag removing margin-left at the bottom of footer.php (will fix without fixing caching issue)

Your style.css is also being called twice :S

to be more clear

    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

can go, as can

array('parent-style')

I manually removed the second link, and the version number from the URL and all was good. Still work on caching, but this will also help, looks better with the centred content area, perhaps add a box shadow to "pop" off the page and add definition to the content.

So I recently moved my servers to SiteGround. Today I learned that they have Super Cache feature enabled by default. THIS was the reason for my problem. Turning this feature off solved the issue.

Thank you for help and effort.

<3

Lewis Cowles
Lewis Cowles
74,902 Points

Thx for getting back to me, I'll make a note of that as I generally prefer that the web-server, not the application itself handling the caching...

I'm guessing sitepoint don't give the level of control of servers I have (I run baremetal), so I would say when you are done editing, re-enable and clear cache (maybe use a plugin), because you will need the speed it brings most likely.

Also if my answer solved it could you please mark it best answer, I don't get involved in the forums much, but I do like to know if something I recommend solves an issue ;)