• i’m building my first wordpress site: https://www.goldcoastchamber.com/wordpress/

    and i ran the validator (click here) but i have no idea where to find the lines of code that the validator says i need to fix!?

    for example, the very first error says i need to check line 59 # <li id="execphp-3" class="widget widget_execphp"><h2>Upcoming Events</h2> but where the heck do i find this text? on line 59 of what file?

    i even downloaded all the files in my remote wordpress folder to dreamweaver, then used the Find tool, and found nothing that resembles it.

    please advise how i interpret the validator. thanks!

Viewing 11 replies - 16 through 26 (of 26 total)
  • Thread Starter goldmember

    (@goldmember)

    alright, i fixed that but there’s still a fatal error. thoughts?

    I guess this is not my day. ??

    <div id="content-main">
    <div id="leftside">
    <?php if ( function_exists('dynamic_sidebar') ) { ?>
      <ul>
        <?php dynamic_sidebar('Main Sidebar') ?>
      </ul>
    <?php } else { ?>
      <h2 class="hide">Main menu:</h2>
      <ul class="page">
      <?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
        <li class="<?php echo $highlight; ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>
        <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
      </ul>
    <?php } ?>
    </div>
    <?php

    The change is at the bottom– second from the last line.

    Thread Starter goldmember

    (@goldmember)

    well the fatal error seems to be gone which is good but now when i run the validator, i have 10 errors instead of the original 5?! ??

    https://validator.w3.org/check?uri=http%3A%2F%2Fwww.goldcoastchamber.com%2Fwordpress%2F&charset=(detect+automatically)&doctype=Inline&group=0&ss=1&outline=1&verbose=1

    you think i should keep the last change and not back it out if there’s more errors? what should i do next? thanks.

    Put the php source of that page– all of it– in the pastebin.

    Thread Starter goldmember

    (@goldmember)

    Thread Starter goldmember

    (@goldmember)

    any idea? please advise.

    How is your sidebar initialized? Look for register_sidebar in your theme’s functions.php.

    Thread Starter goldmember

    (@goldmember)

    i’m not sure what constitues initialized so here’s all the code for my functions.php file:

    <?php
    
    //GsL98DGtpo0W
    
    if ( function_exists('register_sidebar') )
    	register_sidebar(array(
    		'name' => 'Main Sidebar',
    		'before_widget' => '<li id="%1$s" class="widget %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h2>',
    		'after_title' => '</h2>',
    	));
    
    if ( function_exists('register_sidebar') )
    	register_sidebar(array(
    		'name' => 'Right Sidebar',
    		'before_widget' => '', // Removes <li>
    		'after_widget' => '', // Removes </li>
    		'before_title' => '<h2>',
    		'after_title' => '</h2>',
    	));
    
    // WP-Andreas01 Page Navigation
    	function widget_andreas01_pagenav() {
    ?>
    <h2 class="hide">Site menu:</h2>
    <ul class="page">
    <?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
    
    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
    </ul>
    <?php
    }
    if ( function_exists('register_sidebar_widget') )
        register_sidebar_widget(__('Pages'), 'widget_andreas01_pagenav');
    
    // WP-Andreas01 Search
    	function widget_andreas01_search() {
    ?>
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    <?php
    }
    if ( function_exists('register_sidebar_widget') )
        register_sidebar_widget(__('Search'), 'widget_andreas01_search');
    
    // WP-Andreas01 Links
    	function widget_andreas01_links() {
    ?>
    <h2>Links:</h2>
    <ul class="menulist">
    <?php get_links_list(); ?>
    </ul>
    <?php
    }
    if ( function_exists('register_sidebar_widget') )
        register_sidebar_widget(__('Links'), 'widget_andreas01_links');	 
    
    // List Subpages - Code from a plugin by Rob Miller (https://robm.me.uk/). Thanks Rob!
    function list_subpages_andreas01($return = 0) {
    global $wpdb, $post;
    $current_page = $post->ID;
    while($current_page) {
    $page_query = $wpdb->get_row("SELECT ID, post_title, post_parent FROM $wpdb->posts WHERE ID = '$current_page'");
    $current_page = $page_query->post_parent; }
    $parent_id = $page_query->ID;
    $parent_title = $page_query->post_title;
    if($wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id' and post_type = 'page' AND post_status = 'publish' ")) {
    echo'<div id="subpages"><h2>Subpages for '; echo $parent_title; echo':</h2> <ul class="submenu">';
    $html = wp_list_pages("child_of=$parent_id&depth=$depth&echo=".(!$return)."&title_li=0&sort_column=menu_order");
    echo'</ul></div>'; }
    if($return) {
    return $html;
    } else {
    echo $html; } }
    ?>

    please advise. thanks for sticking with me on this issue.

    What is this “//GsL98DGtpo0W”?

    Here is the widget where the error occurs, at least that first error– `
    // WP-Andreas01 Page Navigation. Look at this a couple of lines down--<h2 class=”hide”>Site menu:</h2>`. That is the h2 that the validator is hanging on at line 46.

    That’s odd. Your theme is actually designed to not wrap widgets in <li>‘s on the one sidebar and I’m thinking that is just the sidebar that needs to have a <li> to validate.

    if ( function_exists('register_sidebar') )
    	register_sidebar(array(
    		'name' => 'Right Sidebar',
    		'before_widget' => '', // Removes <li>
    		'after_widget' => '', // Removes </li>
    		'before_title' => '<h2>',
    		'after_title' => '</h2>',
    	));

    You can try matching that sidebar to the other one– that is, add the list item opening and closing. Sorry. I’m fumbling a little bit. Its hard to do this without being able to directly manipulate the source.

    Thread Starter goldmember

    (@goldmember)

    thanks. “add the list item opening and closing” where? where exactly do i put the opening and closing li tags? sorry for my naivete.

    Just look at how the other if ( function_exists('register_sidebar') ) is written. See the ‘before_sidget’ and ‘after_widget’?

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘Not Sure Which Fiels To Edit to Clean Up Validation Errors’ is closed to new replies.