Ondersteuning » Code oplossingen gezocht » hatom errors oplossen (microformats)

  • Google vindt fouten in mijn website (hatom errors). Het thema dat ik gebruik (Spacious) heeft alleen code voor gestructureerde gegevens in berichten (posts), maar mijn website heeft meer pagina’s (pages) dan posts. Wie weet een code om Google tevreden te stellen?

    De codes die ik vond:

    <?php if ( 'post' == get_post_type() ) : ?>
    		<footer class="entry-meta-bar clearfix">
    			<div class="entry-meta clearfix">
    				<span class="by-author author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></span>
    				<span class="date updated"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( get_the_time() ); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a></span>
    				<?php if( has_category() ) { ?>
    	       		<span class="category"><?php the_category(', '); ?></span>
    	       	<?php } ?>

    en

    add_filter('the_content', 'spacious_add_mod_hatom_data');
    // Adding the support for the entry-title tag for Google Rich Snippets
    function spacious_add_mod_hatom_data($content) {
       $title = get_the_title();
       if ( is_single() ) {
          $content .= '<div class="extra-hatom-entry-title"><span class="entry-title">' . $title . '</span></div>';
       }
       return $content;
    }

    Hoe pas ik dit aan zodat het ook voor pagina’s (pages) geldt?

  • Het onderwerp ‘hatom errors oplossen (microformats)’ is gesloten voor nieuwe reacties.