• Resolved Tsevdos

    (@tsevdos)


    Hello all,

    I just undertook a legacy (table-based) site to update it in WP 2.8 and create the WP theme. Everything went according to plan, but I encounter the strangest WP problem ever!

    If you have a look at header.php file, I put all the styles/scripts into the <head> area. Also if you view the source code from the browser (view source), everything looks fine.

    The problem is that, technically all my styles and scripts are located at the top of the body, and not in the <head> section! If you inspect the code with Firebug, you will see it with your own eyes!!! Do you have any idea what’s going wrong? Please have a look at the below code and let me know your thoughts… Is it a WP bug?

    Header.php file

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="" />

    <title><?php if (is_home()) { bloginfo('name');
    } elseif (is_category() || is_page() ||is_single() || is_category() || is_tag() || is_date() || is_author() || is_archive() || is_search() ) {
    bloginfo('name'); echo ' - ';
    }
    wp_title('');
    ?></title>

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <script src="<?php bloginfo('template_directory'); ?>/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="<?php bloginfo('template_directory'); ?>/scripts/jquery.tools.min.js" type="text/javascript"></script>
    <script src="<?php bloginfo('template_directory'); ?>/scripts/AC_RunActiveContent.js" type="text/javascript"></script>

    <!--we need this for plugins-->
    <?php wp_head(); ?>

    </head>
    <body>

    <table width="970" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td colspan="7" nowrap="nowrap" bgcolor="#FFFFFF"><img src="<?php bloginfo('template_directory'); ?>/images/index_01.jpg" width="307" height="175" /></td>
    </tr>
    <tr>
    <td colspan="7">
    <ul id="menu">
    <?php wp_list_pages('sort_column=menu_order&title_li='); ?>

    </td>
    </tr>
    <tr>
    <td colspan="7">test</td>
    </tr>
    <tr>
    <td colspan="7"><img src="<?php bloginfo('template_directory'); ?>/images/index_05.jpg" width="970" height="25" /></td>
    </tr>
    <!--header.php end-->

    I’m also including the index.php file for reference.

    Index.php

    <?php get_header(); ?>
    <tr>
    <td height="135" colspan="7" bgcolor="#FFFFFF">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">

    <h2><?php the_title(); ?></h2>

    <div class="entry">
    <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>

    <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    </div>

    </div>

    <?php endwhile; endif; ?>

    </div>

    </td>
    </tr>
    <!--index.php end-->

    <?php include (TEMPLATEPATH . "/main_extra_gr.php"); ?>

    <!--include footer-->
    <?php get_footer(); ?>

    Thanks in advance,
    Yiannis

Viewing 9 replies - 1 through 9 (of 9 total)
  • you need to look at how it is supposed to be done
    http://codex.wordpress.org/Theme_Development

    Also if you view the source code from the browser (view source), everything looks fine.

    Link please.

    Thread Starter Tsevdos

    (@tsevdos)

    hello again samboll,

    Can you be a bit more specific? I’ve built many WP themes so fr, but I haven’t encounter this problem before… Am I missing something?

    regards,
    yiannis

    provide a link.

    Its a client’s site so if you need to, use tinyurl — but dont ask for help with stuff like that and think because its a client site you dont get to provide a link.

    and before you provide the link — change the theme to the default theme that goes with the version of wordpress being used, an unedited default theme, please.

    Thread Starter Tsevdos

    (@tsevdos)

    I’ll move everything from my localhost somewhere online, and when I’ll have a link, I’ll send it to you.

    Thanks a lot, although I still can’t get what went wrong…

    Thread Starter Tsevdos

    (@tsevdos)

    Hi again,

    You can see the problem at this page !

    If you view the source from the browser everything looks fine, but if you inspect it with Firebug, all the styles (<(link> tags) and scripts are into the body section of the page and NOT into the <head>!!!

    Any ideas/suggestions?!?!?

    umm, I dont see any style stuff outside of the <head></head tags.

    I see this:

    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <meta name="keywords" content="" />
    <title>Test -   Hello world!</title>
    <link rel="stylesheet" href="http://tsevdos.dreamhosters.com/wordpress/wp-content/themes/lantzis-alcan/style.css" type="text/css" media="screen" />
    
    <script src="http://tsevdos.dreamhosters.com/wordpress/wp-content/themes/lantzis-alcan/scripts/jquery-1.3.2.min.js"
    type="text/javascript"></script>
    
    <script src="http://tsevdos.dreamhosters.com/wordpress/wp-content/themes/lantzis-alcan/scripts/jquery.tools.min.js"
    type="text/javascript"></script>
    
    <script src="http://tsevdos.dreamhosters.com/wordpress/wp-content/themes/lantzis-alcan/scripts/AC_RunActiveContent.js"
    type="text/javascript"></script>
    <!--we need this for plugins-->
    
    <meta name='robots' content='noindex,nofollow' />
    <link rel="alternate" type="application/rss+xml" title="Test &raquo; Hello world! Comments Feed" href="http://tsevdos.dreamhosters.com/wordpress/?feed=rss2&p=1" />
    <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://tsevdos.dreamhosters.com/wordpress/xmlrpc.php?rsd" />
    <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://tsevdos.dreamhosters.com/wordpress/wp-includes/wlwmanifest.xml" />
    <link rel='index' title='Test' href='http://tsevdos.dreamhosters.com/wordpress' />
    <link rel='start' title='Hello world!' href='http://tsevdos.dreamhosters.com/wordpress/?p=1' />
    <meta name="generator" content="WordPress 2.8" />
    </head>

    further to that, I suggest working with the validator,

    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Ftsevdos.dreamhosters.com%2Fwordpress%2F%3Fp%3D1

    this is a waste of a thread, and time, and clearly not any kind of a bug.

    what does this mean, anyway?? (do you see that you contradict yourself):

    If you have a look at header.php file, I put all the styles/scripts into the <head> area. Also if you view the source code from the browser (view source), everything looks fine.

    The problem is that, technically all my styles and scripts are located at the top of the body, and not in the <head> section!

    What is seen when one views the source is exactly what should be expected given the header.php and the index.php you pasted out of above.

    Hey, it’s old but still I got here becouse of (almost) same reason. In my case code that was supposed to be in head went to body. Finally after 3 hours I got enlightened. If YOu get simillar problem be sure to convert Your files back to ANSI from UTF-8 (physical files like header.php not coding on webpage)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘The strangest WP problem!’ is closed to new replies.