• I am using Twentyfourteen. I want to add class=”hentry”></article but not sure where to put it. Content.php? Template-tags.php? With single.php, I have no idea where to place it as the file doesn’t have any classes. I want to add this to resolve one of many hAtom errors I have.

Viewing 8 replies - 46 through 53 (of 53 total)
  • is that a static home page based on the ‘showcase’ template ?

    in this case, you will need to edit content-intro.php in a similar way as you have done with content-page.php

    Thread Starter Dan14

    (@dan14)

    Hi Alchymyth, thank you for your reply!! No, the home page consists of the latest posts and is not static, I should’ve mentioned this earlier. Is the editing the same, content-intro.php?

    Is the editing the same, content-intro.php?

    no – I referred mistakenly to the files of Twenty Eleven ??

    are you using ‘featured’ posts on the front page?

    these are calling content-featured-post.php which does not use the function ‘twentyfourteen_posted_on()’ – you will need to add it as you have done for the pages.

    example:

    <?php
    /**
     * The template for displaying featured posts on the front page
     *
     * @package WordPress
     * @subpackage Twenty_Fourteen
     * @since Twenty Fourteen 1.0
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<a class="post-thumbnail" href="<?php the_permalink(); ?>">
    	<?php
    		// Output the featured image.
    		if ( has_post_thumbnail() ) :
    			if ( 'grid' == get_theme_mod( 'featured_content_layout' ) ) {
    				the_post_thumbnail();
    			} else {
    				the_post_thumbnail( 'twentyfourteen-full-width' );
    			}
    		endif;
    	?>
    	</a>
    
    	<header class="entry-header">
    		<?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    		<div class="entry-meta">
    			<span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
    		</div><!-- .entry-meta -->
    		<?php endif; ?>
    
    		<?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">','</a></h1>' ); ?>
    		<div class="entry-meta">
    			<?php twentyfourteen_posted_on(); ?>
    		</div><!-- .entry-meta -->
    	</header><!-- .entry-header -->
    </article><!-- #post-## -->

    not tested if this might interfere with the formatting.

    if this is not it, you might need to post a link to your site to illustrate the content of your home index page.

    Thread Starter Dan14

    (@dan14)

    Thank you for reply Alchymyth!!! Indeed I am using featured posts but as a slider, I didn’t know it is important to say. Is the content-featured-posts.php still the file I need to edit?

    Indeed I am using featured posts but as a slider, I didn’t know it is important to say. Is the content-featured-posts.php still the file I need to edit?

    I haven’t tested that – just try it.

    Thread Starter Dan14

    (@dan14)

    Thank you Alchymyth!! It think this is going to work. I will wait for the next crawl and see if the errors were moved.

    I will keep you updated!!

    Thread Starter Dan14

    (@dan14)

    Hi Alchymyth! I spoke too soon. Inserting the code in content-featured-post.php breaks the front page… ?? Any suggestions what I should do?

    please post the full code of the edited template.

    can you post a link to illustrate the effect on the front page?

Viewing 8 replies - 46 through 53 (of 53 total)
  • The topic ‘Where to add class hentry in twentyfourteen’ is closed to new replies.