Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #35611

    Kevin .
    Participant

    Theme X generates a timestap/date for Google. These time/date stamps are in the search results of google.

    <span class=”visually-hidden”><span class=”author vcard”><span class=”fn”>admin</span></span><span class=”entry-title”>xxxxx</span><time class=”entry-date updated” datetime=”2014-02-20T17:12:48+00:00″>03.10.2014</time></span></article>

    How do i get rid off this time/date stamp?

    #35774

    Support
    Member

    Hi Kevin!

    Thank you for using the theme!

    You can remove the entry date for hatom entries by removing the css selector. Add this on Customizer > Custom > Javascript.

    jQuery( 'time.updated' ).removeClass( "entry-date" );
    

    Let us know if it works. Cheers!

    #36098

    Kevin .
    Participant

    Hi, thanks for your cool support 😉

    No, it didn’t work. I have pasted the code in the customizer, custom javascript and saved.

    Refreshed the page but when i take a look at the html i still see:
    <span class=”visually-hidden”><span class=”author vcard”><span class=”fn”>admin</span></span><span class=”entry-title”>Home</span><time class=”entry-date updated” datetime=”2014-04-21T21:11:45+00:00″>04.21.2014</time></span>

    I did some research myself. I have edited the file in /framework/functions/global/social.php and did this:

    /*
    $date = sprintf( ‘<time class=”entry-date updated” datetime=”%1$s”>%2$s</time>’,
    esc_attr( get_the_date( ‘c’ ) ),
    esc_html( get_the_date( ‘m.d.Y’ ) )
    );

    printf( ‘<span class=”visually-hidden”>%1$s%2$s%3$s</span>’,
    ‘<span class=”author vcard”><span class=”fn”>’ . $author . ‘</span></span>’,
    ‘<span class=”entry-title”>’ . $title . ‘</span>’,
    $date
    );

    */

    I have commented out the code that is responsible for the time/date stamp. I know this is not the right solution because when i update the theme i must also edit this again.

    So hope you have another solution because the custom javascript is not working for me 🙁

    Then antoher thing. Why do you guys show a date/time stamp in created pages? I understand the time/date stamp for blog posts but not for pages. It’s killing CTR in Google when you show a date/time stamp in google search results.

    An example. Created a website PAGE in january 2014. When somebody google this site in july 2016 they will see the date stamp in google and think…. hey, that an old webpage. I’m gonna skip that site. So i don’t understand why a date/time stamp for created pages.

    #36322

    Alexander
    Keymaster

    Hi Kevin,

    Nice work with that functions code! You’re very close here. Your modifications will work, but to restore the dates to other parts of the site you can use the code below.

    Instead of modifying X directly, you can just add this code directly to the functions.php file of a child theme.

    X will notice you provided a modified version in the child theme, and go with that instead.

    // Google Authorship Meta
    // =============================================================================
    
    if ( ! function_exists( 'x_google_authorship_meta' ) ) :
      function x_google_authorship_meta() {
    
        $author = sprintf( '%s', get_the_author() );
    
        $title = sprintf( '%s', get_the_title() );
    
        $date = '';
    
        if( !is_page() ) {
          $date = sprintf( '<time class="entry-date updated" datetime="%1$s">%2$s</time>',
            esc_attr( get_the_date( 'c' ) ),
            esc_html( get_the_date( 'm.d.Y' ) )
          );
        }
    
        printf( '<span class="visually-hidden">%1$s%2$s%3$s</span>',
          '<span class="author vcard"><span class="fn">' . $author . '</span></span>',
          '<span class="entry-title">' . $title . '</span>',
          $date
        );
    
      }
    endif;

    Let us know how it goes!

    #36540

    David D
    Participant

    I’m running into the same issue.. but am NOT using a child theme. I found out about that too late in the process. But I want to remove the author info from the HTML Source. Is that Javascript supposed to work?

    #36599

    David D
    Participant

    Or maybe there is a way to create a “dummy” user and somehow assign ownership of the page it it and have it rendered in there? I just don’t want the admin id showing up in the html source.

    #36614

    David D
    Participant

    That’s what I did as a temporary workaround. I created a new “user”, then went into the page list, selected all the pages and did a bulk “edit” and changed the owner to that new user. Now that’s the name that shows up in the HTML as the owner.

    #36709

    Kevin .
    Participant

    Hi support,

    Thanks. It worked!

    #36882

    Rad
    Moderator

    Hi Keving,

    Glad it worked! You’re welcome.

    @David, glad your alternative works. But as advice, you may need to move on child theme. Permanent solution is always best.

    Thank you.