While setting up my Google Webmaster Tools I ran into the problem that WordPress in combination with the nice Parabola Theme is not 100% conformed the Google expectations. I saw some errors on the page and tried to figure out what exactly triggers this error. On the overview page I found these entries.
The crawler of Google searches for the hatom information on the page. For my page it finds most of the tags, like the author, the title, the content and also the publish date. But it searches also specific for the field “updated”. The failure occures more often on category sites, because there are more entries, and only once on the simple post.
After some research I found a solution by adding some simple lines to some files in the theme. But because you still want to update your theme, the best way to edit your theme is by adding a child to the normal theme. This is basically done by creating a new folder under /wp-content/themes/ with the name %theme-name%-child. In my case this was “parabola-child”. After creating a child folder, a file named sytle.css has to be created in the folder. The basic setup is in my case:
/* Theme Name: TL-PHOTOGRPAHY Theme URI: http;//www.tl-photography.at Description: Customize Parabola Author: Thomas Leber Author URI: https://www.tl-photography.at Template: parabola Version: 1.0.0 License: GNU General Public License v3.0 */ @import url("../parabola/style.css");
The most important line is Template: parabola. This tells WordPress that this is a child of the Parabola theme. All steps can be found here. WordPress will now load all files from the child folder and override the corresponding files of the main theme. Basically you can copy a file like header.php to the child theme and edit it. The rest of the files will be loaded from the main theme. In our case I searched the content.php and found a link to the parabola_posted_on() in includes/theme-loop.php function. This function provides the meta information of the post and can also be used to write the additional tags to the page. Unfortunately, after i copied and edited my file, WordPress was still loading the main file. This seems to be a bug or i did simply something wrong, ten times or so… Anyway, I decided to change in this case the content.php file. I copied the snipped from here and added the “hidden=true” to prevent that information from rendering to the screen.
<h2 class="entry-title"> <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'parabola' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a> </h2> <span class="post-date published" hidden="true"><?php the_time( get_option( 'date_format' ) ); ?></span> <span class="post-date updated" hidden="true"><?php the_modified_time( get_option( 'date_format' ) ); ?></span> <?php cryout_post_title_hook(); ?><?php if ( 'post' == get_post_type() ) : ?> <div class="entry-meta"> <?php parabola_posted_on(); cryout_post_meta_hook(); ?> </div><!-- .entry-meta --> <?php endif; ?>
After this modification, the category pages will have the hidden information and Google will crawl these pages without errors. But the single post will still have this failure. So again, after some searching, I figured out that this is related to the file single.php. So I added the same two lines there.
<h1 class="entry-title"><?php the_title(); ?></h1> <?php cryout_post_title_hook(); ?> <span class="post-date published" hidden="true"><?php the_time( get_option( 'date_format' ) ); ?></span> <span class="post-date updated" hidden="true"><?php the_modified_time( get_option( 'date_format' ) ); ?></span> <div class="entry-meta"> <?php parabola_posted_on(); cryout_post_meta_hook(); ?> </div><!-- .entry-meta -->
It seems that the theme also deliverers wrong data to the crawler when showing single posts. In the picture on the side,it is visible that it writes for the bookmark the date and not the name of the post. But i was fine with the result until now. Maybe i’ll fix this later or write a bug report to the programmer.