StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   How can I solve W3C errors? (http://www.studiopress.com/support/showthread.php?t=119527)

gemini 10-02-2012 06:55 PM

How can I solve W3C errors?
 
Using Streamline child theme:


I did check the W3C Markup Validation Service on ip-192.com and get 2 errors.


Error Line 243, Column 6: end tag for element "div" which is not open
</div> <div id="footer-widgeted">
This Error belongs to an empty sidebar-bottom-left div, which is correct defined.


Error Line 280, Column 6: end tag for element "div" which is not open
</div>
<div id="sidebar-bottom-left">
</div>
This Error closes a widget_nav_menu.


I see unclosed </body> and </html> tags at the bottom of the page.


This problem happens at Streamline child home pages with different customizations.

Any hint how I can solve this would be very much appreciated.

NicktheGeek 10-03-2012 01:18 PM

start by checking any text widgets you have. Those are the most likely place for bad HTML. What changes did you make to the home.php file?

gemini 10-03-2012 01:46 PM

Please see the content of the home.php below. I don't recall any changes on my end.
PHP Code:

<?php get_header(); ?>

<?php genesis_before_content_sidebar_wrap(); ?>
<div id="content-sidebar-wrap">

    <?php genesis_before_content(); ?>
    <div id="content" class="hfeed">
        
        <div id="homepage">
            <?php if (!dynamic_sidebar('Homepage')) : ?>
                <div class="widget">
                    <h4><?php _e("Homepage"'genesis'); ?></h4>
                    <div class="wrap">
                        <p><?php _e("This is a widgeted area which is called Homepage. It is using the Dynamic Content Gallery plugin and the Genesis - Featured Posts widget to display what you see on the Streamline child theme demo site. To get started, you'll need to download the plugin from the link given in the Streamline child theme's README file. Then log into your WordPress dashboard, and then go to the Appearance > Widgets screen. There you can drag the Dynamic Content Gallery widget and the Genesis - Featured Posts widget into the Homepage widget area on the right hand side."'genesis'); ?></p>
                    </div><!-- end .wrap -->
                </div><!-- end .widget -->
            <?php endif; ?>
        </div><!-- end #homepage -->                    

    </div><!-- end #content -->
    <?php genesis_after_content(); ?>

</div><!-- end #content-sidebar-wrap -->
<?php genesis_after_content_sidebar_wrap(); ?>

<?php get_footer(); ?>

I did replace the DCG with the Smart Slideshow widget, but couldn't find bad code there.

The 4 footers are served by custom menus. I checked the the other widgets, but couldn't find any unclosed items.

I don't understand the unclosed </body> and </html> tags at the bottom of the page.

NicktheGeek 10-03-2012 02:21 PM

what edits have you made?

gemini 10-03-2012 02:22 PM

none

NicktheGeek 10-03-2012 02:28 PM

Then it has to be content, either in the post or via a text widget.

gemini 10-03-2012 02:34 PM

I have the same 2 (only) errors on all Streamline child home pages with different child-css, widgets, and one site has no posts and widgets at all on the front page. I am clueless where to start.

NicktheGeek 10-03-2012 03:00 PM

Then something was changed in the theme files. What is in the functions.php file

gemini 10-03-2012 03:13 PM

function.php:
PHP Code:

<?php
// Start the engine
require_once(TEMPLATEPATH.'/lib/init.php');

// Add topnav section
add_action('genesis_before_header''streamline_include_topnav'); 
function 
streamline_include_topnav() {
    require(
CHILD_DIR.'/topnav.php');
}

// Add widgeted footer section
add_action('genesis_before_footer''streamline_include_footer_widgets'); 
function 
streamline_include_footer_widgets() {
    require(
CHILD_DIR.'/footer-widgeted.php');
}

// Force layout on homepage
add_filter('genesis_pre_get_option_site_layout''streamline_home_layout');
function 
streamline_home_layout($opt) {
    if ( 
is_home() )
    
$opt 'content-sidebar';
    return 
$opt;
}  

// Add two sidebars to the main sidebar area
add_action('genesis_after_sidebar_widget_area''streamline_include_bottom_sidebars'); 
function 
streamline_include_bottom_sidebars() {
    require(
CHILD_DIR.'/sidebar-bottom.php');
}  

// Register widget areas
genesis_register_sidebar(array(
    
'name'=>'Sidebar Bottom Left',
    
'description' => 'This is the bottom left column in the sidebar.',
    
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));
genesis_register_sidebar(array(
    
'name'=>'Sidebar Bottom Right',
    
'description' => 'This is the bottom right column in the sidebar.',
    
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));  
genesis_register_sidebar(array(
    
'name'=>'Homepage',
    
'description' => 'This is the featured column of the homepage.',
    
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));
genesis_register_sidebar(array(
    
'name'=>'Footer #1',
    
'description' => 'This is the first column of the footer section.',
    
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));
genesis_register_sidebar(array(
    
'name'=>'Footer #2',
    
'description' => 'This is the second column of the footer section.',
    
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));
genesis_register_sidebar(array(
    
'name'=>'Footer #3',
    
'description' => 'This is the third column of the footer section.',
    
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));
genesis_register_sidebar(array(
    
'name'=>'Footer #4',
    
'description' => 'This is the fourth column of the footer section.',
    
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));

function 
_remove_script_version$src ){
    
$parts explode'?'$src );
    return 
$parts[0];
}
add_filter'script_loader_src''_remove_script_version'15);
add_filter'style_loader_src''_remove_script_version'15);

?>


NicktheGeek 10-03-2012 04:10 PM

ok what is in your footer-widgeted.php file?

gemini 10-03-2012 04:40 PM

footer-widget.php
PHP Code:

<div id="footer-widgeted">
    <div class="wrap">
        <div class="footer-widgeted-1">
            <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer #1') ) : ?>
                <h4><?php _e("Footer #1 Widget"'genesis'); ?></h4>
                <p><?php _e("This is an example of a widgeted area that you can place text to describe a particular product or service. You can also use other WordPress widgets such as recent posts, recent comments, a tag cloud or more."'genesis'); ?></p>
            <?php endif; ?> 
           </div><!-- end .footer-widgeted-1 -->
        <div class="footer-widgeted-2">
            <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer #2') ) : ?>
                <h4><?php _e("Footer #2 Widget"'genesis'); ?></h4>
                <p><?php _e("This is an example of a widgeted area that you can place text to describe a particular product or service. You can also use other WordPress widgets such as recent posts, recent comments, a tag cloud or more."'genesis'); ?></p>
            <?php endif; ?> 
        </div><!-- end .footer-widgeted-2 -->
        <div class="footer-widgeted-3">
            <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer #3') ) : ?>
                <h4><?php _e("Footer #3 Widget"'genesis'); ?></h4>
                <p><?php _e("This is an example of a widgeted area that you can place text to describe a particular product or service. You can also use other WordPress widgets such as recent posts, recent comments, a tag cloud or more."'genesis'); ?></p>
            <?php endif; ?> 
        </div><!-- end .footer-widgeted-3 -->
        <div class="footer-widgeted-4">
            <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer #4') ) : ?>
                <h4><?php _e("Footer #4 Widget"'genesis'); ?></h4>
                <p><?php _e("This is an example of a widgeted area that you can place text to describe a particular product or service. You can also use other WordPress widgets such as recent posts, recent comments, a tag cloud or more."'genesis'); ?></p>
            <?php endif; ?> 
        </div><!-- end .footer-widgeted-4 -->
    </div><!-- end .wrap -->
</div><!-- end #footer-widgeted -->


NicktheGeek 10-03-2012 08:30 PM

topnav.php?

gemini 10-03-2012 09:30 PM

topnav.php:
PHP Code:

<div id="topnav">
    <div class="topnav-left">
        <p><?php echo date("l, F jS, Y g:i a"current_time('timestamp')); ?></p>
    </div><!-- end .topnav-left -->
    <div class="topnav-right">
        <p>
            <a class="rss-topnav" rel="nofollow" href="<?php bloginfo('rss_url'); ?>"><?php _e("Posts"'genesis'); ?></a>
            <a class="rss-topnav" rel="nofollow" href="<?php bloginfo('comments_rss2_url'); ?>"><?php _e("Comments"'genesis'); ?></a>
        </p>
    </div><!-- end .topnav-right -->
</div><!-- end #topnav -->


NicktheGeek 10-04-2012 07:59 AM

sidebar-bottom.php?

gemini 10-04-2012 09:10 AM

Good morning, Nick!
sidebar-bottom.php:
PHP Code:

<div id="sidebar-bottom">
    <div id="sidebar-bottom-left">
        <?php if (!dynamic_sidebar('Sidebar Bottom Left')) : ?>
        <?php endif; ?>
    </div><!-- end #sidebar-bottom-left -->
    <div id="sidebar-bottom-right">
        <?php if (!dynamic_sidebar('Sidebar Bottom Right')) : ?>
        <?php endif; ?>
    </div><!-- end #sidebar-bottom-right -->
</div>


NicktheGeek 10-04-2012 09:16 AM

I believe that is all the theme files. Unless something was changed in Genesis it has to be coming from a plugin or content.

gemini 10-04-2012 09:30 AM

You may like to check this site. I has less content on the home page and shows the same W3C symptoms. I did eliminate footers, sidebars, and posts. It shows the slider and some entries placed in the simple hooks section.

NicktheGeek 10-04-2012 12:23 PM

I went through line by line and did find an extra </div>

You are editing the footer of both sites, how are you changing the footer?

gemini 10-04-2012 01:19 PM

I use the Genesis Footer Hook. Execute PHP on this hook? = yes, i.e. Gemini:
PHP Code:

<p>&copy; <?php echo date('Y');?> &middot; <a href="http://www.ip-192.com/" title="Gemini · www.ip-192.com">Gemini · www.ip-192.com</a> &middot; All rights reserved.</p>
<p><a href="#wrap" rel="nofollow">Return to top of page</a></p>


NicktheGeek 10-04-2012 01:46 PM

somewhere there is a </div> being added. I see other code added where I wouldn't normally see it, some <scripts> in #header and other places.

Try disabling all plugins and test.

gemini 10-04-2012 03:50 PM

I tried to figure out exactly this where the extra </div>’s coming from. Since it is on each Streamline home page (with different plugins, widgets, posts/no posts, with/without footer widgets), I thought Genesis parent theme could be the source, but I don’t know. I did upgrade Genesis to the latest version 1.8.2.

NicktheGeek 10-04-2012 04:03 PM

If it is only on the home page my first guess would be the home.php file, but you posted that and I went through it. It is all correct.

If it were the parent files then it would affect other pages, not just the home page. So it cannot be the parent files, not unless they were edited with an is_home/is_front_page() conditional that changes the output only on the home page.

This means it has to be related to content. Even if it is different plugins there has to be something common tying it together.

gemini 10-19-2012 07:34 AM

I did check some other pages/posts with W3C, but it found these errors on the home page only.

NicktheGeek 10-19-2012 09:05 AM

it still points to content or plugins. The other possibilities have been eliminated.

gemini 10-19-2012 09:32 AM

The previous/next buttons of the Smart Slideshow Widget are responsible for the errors; without them the sites pass the test.

Thanks again NicktheGeek, please feel free to close the thread.

NicktheGeek 10-19-2012 10:41 AM

You're welcome.

Since this is resolved I'm going to close this thread.


All times are GMT -5. The time now is 06:39 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.