Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1137509
    Rad
    Moderator

    Hi there,

    Please try this,

    function remove_hentry_class( $classes ) {
        if ( is_home() ) {
           $classes = array_diff( $classes, array( 'hentry' ) );
        }
        return $classes;
    }
    
    add_filter( 'post_class', 'remove_hentry_class', 999 );
    
    // Structure Data Fix
    // ==========================
    //add hatom data
    function add_suf_hatom_data($content) {
        $t = get_the_modified_time('F jS, Y');
        $author = get_the_author();
        $title = get_the_title();
    if (is_home() || is_singular() || is_archive() ) {
            $content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>';
        }
    
       echo $content; 
    
        }
    
    add_action('wp_footer', 'add_suf_hatom_data');
    
    add_action('wp_footer', 'modified_date_updated_content');
    
    function modified_date_updated_content( $content ) {
      if ( !isset($_GET['cornerstone']) && $_GET['cornerstone'] != 1 && !is_page() && !is_singular( 'x-portfolio' ) ) {
    
        $content .= '<br><div class="hatom-extra"><span class="entry-title">'. get_the_title() .'</span> was last modified: <span class="updated"> '. get_the_modified_time('F jS, Y') .'</span> by <span class="author vcard"><span class="fn">'. get_the_author() .'</span></span><br><br></div>';
    
       echo $content;
    
      } 
    }

    Thanks!

    #1145501
    garlicfox
    Participant

    Hello, I still seem to be having this issue as google just recently rescanned the site and picked up more missing fields… I’ll put a screenshot of my search console in the next post. Thanks for your continued help on this…

    #1145502
    garlicfox
    Participant
    This reply has been marked as private.
    #1146008
    Rue Nel
    Moderator

    Hello There,

    Are you using CloudFlare or may have installed a caching plugin like WordFence, W3 Total Cache or WP Super Cache? Please keep in mind that after doing every updates or making any site changes, always remember to clear all caches when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.

    Hope this helps. Kindly let us know.

    #1146448
    garlicfox
    Participant

    Hello. Yes i’m using both cloudflare and W3 Total Cache. I could have sworn that I had done this *but* just to be sure I deleted the cache on both W3 Total Cache and Cloudflare. I have since re-run the structure data test tool by google and get the same result.

    Before: http://screencast.com/t/lfBPwnwl9OiR
    After: http://screencast.com/t/ljjgXmoQ

    #1147204
    Rad
    Moderator

    Hi there,

    It looks like it really needs to be added within the content instead of footer. Please change this,

    add_action('wp_footer', 'add_suf_hatom_data');
    
    add_action('wp_footer', 'modified_date_updated_content');

    to this

    add_action('the_content', 'add_suf_hatom_data');
    
    add_action('the_content', 'modified_date_updated_content');

    Or directly edit the templates and add the required data.

    Thanks!

    #1147374
    garlicfox
    Participant
    This reply has been marked as private.
    #1147718
    Rad
    Moderator

    Hi there,

    Hmm, what’s that? It’s not part of the provided code. Hmm this quite hard, I checked the forum with similar topic, and has a similar solution which worked on their end.

    Would you mind removing all those codes and follow as exactly as this?

    https://community.theme.co/forums/topic/structured-data-testing-tool-by-google-webmaster/#post-176632

    And please provide your admin and FTP login credentials in private reply. I like to check it directly.

    Thanks!

    #1148273
    garlicfox
    Participant
    This reply has been marked as private.
    #1148822
    Rad
    Moderator

    Hi there,

    In that case, I’ll try investigating it on my end. Yes, I’m aware of what you’re getting but since there is no way for me to test it then all I could do is forward it to our developers.

    Thanks!

    #1149890
    garlicfox
    Participant

    Thank you very much, really apprecaited. If we can make a change to make sure the structure data is working correctly within the themes – even in the releases i’m sure it would help many webmasters. Please keep me posted.

    #1150165
    Rad
    Moderator

    Sure, Thanks for understanding.

    #1152409
    garlicfox
    Participant

    Just to add further info I noticed I was running a little behind (maintenance releases only) on the updates of xtheme and wanted to let you know that I brought out site up to the current version and the issue still exists. Thought it was worth while to mention. Did any of the developers have a chance to have a look yet? Much appreciated!

    #1152957
    Lely
    Moderator

    Hi There,

    Thank you for those information. It was already forwarded but no update yet as of the moment. We will let you know once they review the issue. Thank you for understanding.

  • <script> jQuery(function($){ $("#no-reply-1125832 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>