• I’ve been researching this and can’t find a solution. From what I understand there are duplicate ids on my wordpress site and they should be changed to classes instead? But where/how am I supposed to do this? Apologies if it’s been addressed here before, but I couldn’t find it.

    Example:

    Error Duplicate ID  searchform .
    From line 1680, column 59; to line 1680, column 150
    t_search”><form role=”search” method=”get” id=”searchform” 
    action=”http://staging.site.com/”>↩  <div

Viewing 4 replies - 1 through 4 (of 4 total)
  • Please try asking for assistance in the plugin’s dedicated forum:
    https://ww.wp.xz.cn/support/plugin/w3-total-cache

    Thread Starter caldejesus

    (@portokie)

    Never received a reply, if anybody knows how to fix this I’d appreciate it. My site won’t be W3C compliant until then.

    Thread Starter caldejesus

    (@portokie)

    Still haven’t found a way to fix this issue. Can somebody PLEASE at least point me in the right direction? I don’t know what I’m supposed to do. Site is not w3c compliant.

    You could try this:
    If there’s a searchform.php inside your theme folder, WordPress uses this file instead of the WP search form.

    1. Check if there’s a searchform.php inside your theme folder
    2. If not, create a file named searchform.php inside your theme folder
    3. Now you can customize your search form as you like. And you can give the form an unique ID using something like id=”<?php echo uniqid() ;?>”
    4. If there’s already a searchform.php inside your theme folder, you can add this to the <form> tag as well.
    5. Get yourself a cup of coffee and enjoy W3C checker turning green 🙂

    The searchform.php could look like this:

    
    <form role="search" method="get" class="searchform group" id="<?php echo uniqid() ;?>" action="<?php echo home_url( '/' ); ?>">
     <label>
     <span class="offscreen"><?php echo _x( 'Suche nach:', 'label' ) ?></span>
     <input type="search" class="search-field"
     placeholder="<?php echo esc_attr_x( 'Suchbegriff', 'placeholder' ) ?>"
     value="<?php echo get_search_query() ?>" name="s"
     title="<?php echo esc_attr_x( 'Suche nach:	', 'label' ) ?>" />
     </label>
     <input type="image" alt="Submit search query"
     src="<?php echo get_template_directory_uri(); ?>/images/search.png">
    </form>
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How do I fix W3C duplicate id errors?’ is closed to new replies.