• I’ve just finished developing a bespoke theme for http://www.homestogether.net/ and have noticed that ALL CSS and a lot of coding is visible from the source code:

    Here is the <head> section of the header.php file in the theme:

    <?php
    /**
     * Header template for our theme
     *
     * Displays all of the <head> section and everything up till <div id="main">.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <meta name="p:domain_verify" content="2128589c6e637dceaefa30d42a6690b7"/>
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 */
    	global $page, $paged;
    
    	wp_title( '|', true, 'right' );
    
    	// Add the blog name.
    	bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
    		echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
    
    	?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    <link href="http://fonts.googleapis.com/css?family=Cabin:400,500,700" rel="stylesheet" type="text/css">
    <?php
    	/*
    	 * We add some JavaScript to pages with the comment form
    	 * to support sites with threaded comments (when in use).
    	 */
    	if ( is_singular() && get_option( 'thread_comments' ) )
    		wp_enqueue_script( 'comment-reply' );
    
    	/*
    	 * Always have wp_head() just before the closing </head>
    	 * tag of your theme, or you will break many plugins, which
    	 * generally use this hook to add elements to <head> such
    	 * as styles, scripts, and meta tags.
    	 */
    	wp_head();
    ?>
    </head>

    I cannot for the life of me work out what is causing this. I have deactivated all plugins and reactivated them, and none of them seem to be making a difference. The plugins being used are:

    Black Studio TinyMCE Widget
    Version 2.2.5

    Contact Form 7
    Version 4.2.2

    Custom Facebook Feed Pro
    Version 2.1.1

    Enhanced Text Widget
    Version 1.4.5

    EWWW Image Optimizer
    Version 2.5.0

    Exec-PHP
    Version 4.9

    NextGEN Gallery by Photocrati
    Version 2.1.2

    Page-list
    Version 5.1

    Page Builder by SiteOrigin
    Version 2.1.4

    Regenerate Thumbnails
    Version 2.2.4

    Responsive Menu
    Version 2.8.1

    Share Buttons by AddToAny
    Version 1.6.2

    SiteOrigin Widgets Bundle
    Version 1.4

    Types – Complete Solution for Custom Fields and Types
    Version 1.6.6.2

    WP Accessibility
    Version 1.4.2

    WP Migrate DB
    Version 0.7.1

    WP Subtitle
    Version 2.4.1

Viewing 9 replies - 1 through 9 (of 9 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It’s not all your CSS is it? It looks like mainly your menu and grid stuff

    Thread Starter JigMedia

    (@jigmedia)

    Can you see where it starts: ?

    <style media="all" type="text/css" style="display:none">/*
    Theme Name: Homes Together
    Author: Ricky Bailey
    Version: 1.0
    Text Domain: homestogether
    */
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Where is that inline, in your HTML?
    view-source:http://www.homestogether.net/

    Thread Starter JigMedia

    (@jigmedia)

    Yes, that’s what I see in the view-source:http://www.homestogether.net/, however it shouldn’t be there. It’s not set as inline, it’s set as:

    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I don’t understand, why should your <link> elements not be in the source code?

    Thread Starter JigMedia

    (@jigmedia)

    They should be, but in the source code you should see:

    “<link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘stylesheet_url’ ); ?>” />”

    but instead, you see:

    ‘<style media=”all” type=”text/css” style=”display:none”>/*
    Theme Name: Homes Together
    Author: Ricky Bailey
    Version: 1.0
    Text Domain: homestogether
    */’ and it continues to display my entire style sheet, which should be external…

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Where do you see that?
    I checked your source code and couldn’t find that: view-source:http://www.homestogether.net/

    Thread Starter JigMedia

    (@jigmedia)

    Starts line 10, why can only I see it? I’m going to try a different connection… currently using my personal hotspot on iPhone

    Thread Starter JigMedia

    (@jigmedia)

    VERY strange! When I connect to my broadband, it’s all normal!
    Nothing to worry about here then, please close. Thanks Andrew for your help.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘All my header code seems to be displaying inline, including CSS!’ is closed to new replies.