Support » Theme: Customizr » Customizr and HFeed Warning

  • Resolved deinezauber

    (@deinezauber)


    Hi all,
    Google Webmaster is notifying me with a warning that I’m not providing the field “updated” on the web pages of my WordPress (“Warning: Missing required field “updated”.”).

    I’ve already found a quick fix of this issue on several web sites that suggest to:

    In your single.php file find the_time or echo get_the_date(); and enclose it into a span tag with attribute.

    For example, I should write something like:

    <span class="date updated"><?php echo get_the_date();?></span>

    or

    <span class="date updated"><?php the_time(); ?></span>

    The question is: how do I implement this fix in Customizr?
    Thank for your kind support,
    Nicola

Viewing 7 replies - 1 through 7 (of 7 total)
  • Having a deeper look into the HTML source code of a post page (I’ve also tried to dive into the code but… not sure where I should have a look), the place where the UPDATE info should be is inside the:

    <div class="entry-meta">

    Am I right? How could I inject the publication date and the last update date?
    Thank you,
    Nicola

    I’ve searched again and again and maybe I’ve found something suitable form my needs.
    Nikeo documented how to replace the post writing date with the last post update date in the code snippet section of his site; I’ve further modified this script in order to add also the SPAN tag for hatom feed:

    add_filter( 'tc_date_meta' , 'display_the_update_date');
    function display_the_update_date() {
        return sprintf( '<a href="%1$s" title="updated %2$s" rel="bookmark"><time class="entry-date" datetime="%3$s"><span class="date updated">%4$s</span></time></a>' ,
            esc_url( get_day_link( get_the_time( 'Y' ), get_the_time( 'm' ), get_the_time( 'd' ) ) ),
            esc_attr( get_the_modified_date('F j, Y') ),
            esc_attr( get_the_modified_date('c') ),
              get_the_modified_date('F j, Y')
        );
    }

    The problem is that this filter seems is not being applied and I don’t understand why… I’ve disabled the W3 Total Cache plugin and cleaned my web browser cache but I can’t see differences… any idea?
    Thank you,
    Nicola

    You’re doing very well in diagnosing this!

    Customizr is built with lots of hooks to enable filter customization rather than editing templates.

    If its not being picked up, then where did you put this code? It should be placed in a Child Theme functions.php. Basic document here.

    Thank you! Sorry for not mentioning it… yes, I’ve added that snippet code in the file functions.php of my child theme, using obviously Customizr as parent theme.

    The only thing I’d like to know now is if someone has already used this ‘tc_date_meta’ hook or if there is a typo preventing it from working.

    Thank you again,
    Nicola

    I’ve found it!!!

    The reason is that in my version of Customizr (3.0.15) that hook was not supported, so no surprises if the theme is not calling my function; in details, the class involved is the ‘class-content-post_metas.php’ and here you can see the row #62 in the version 3.0.15:

    $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>' ,

    Same file, version 3.1.5, row #68:

    $date               = apply_filters( 'tc_date_meta',
                                        sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>' ,

    So I can consider this topic closed, I hope it’ll be useful for other users with the same problem.
    Ciao!
    Nicola

    There were some significant changes after 3.0.15.

    Brilliant work!

    Thank you sir!
    Nicola

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Customizr and HFeed Warning’ is closed to new replies.