WordPress.org

Make WordPress Core

Opened 12 months ago

Last modified 11 months ago

#45555 new defect (bug)

Twenty Nineteen: Remove duplicate meta info on single post

Reported by: pratikkry Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.0
Component: Bundled Theme Keywords: has-patch needs-testing
Focuses: Cc:
PR Number:

Attachments (2)

712-twentynineteen-postmeta.jpg (29.9 KB) - added by laurelfulford 11 months ago.
Twenty Nineteen - post meta on a shorter post.
45555.diff (659 bytes) - added by pratikkry 11 months ago.
i tried something cool

Download all attachments as: .zip

Change History (7)

#1 @subrataemfluence
12 months ago

  • Keywords dev-feedback added

I am not sure either if this is a desired behavior, but to me it is a welcome behavior, specially for long posts.

I would however like to suggest the following modification in twentynineteen_entry_footer in /var/www/wp-projects/subratasarkar.com/wp-content/themes/twentynineteen/inc/template-tags.php file which will allow us to customize the behavior of entry-footer as per our need.

<?php
if ( ! function_exists( 'twentynineteen_entry_footer' ) ) :
   /**
     * Prints HTML with meta information for the categories, tags and comments.
     */
   function twentynineteen_entry_footer( $show_post_meta = true ) {
		
      if( ! $show_post_meta ) return;
		
      // Hide author, post date, category and tag text for pages.
      if ( 'post' === get_post_type() ) {
			
         // Posted by
	 if( is_array( $show_post_meta ) && ! empty( $show_post_meta ) ) {
	    if( true === $show_post_meta['show_author'] ) {
		twentynineteen_posted_by();
     	    }
         } else {
            twentynineteen_posted_by();
         }
			
	 // Posted on
	 if( is_array( $show_post_meta ) && ! empty( $show_post_meta ) ) {
	    if( true === $show_post_meta['posted_on'] ) {
		twentynineteen_posted_on();
	    }
	 } else {
	    twentynineteen_posted_on();
	 }
      }
   }

   ... rest of the code remains intact ...

endif;

And this is how we can call it:

<footer class="entry-footer">
   <?php
   //$post_meta_options = false;
   $post_meta_options = array(
	'show_author' => false,
  	'posted_on'   => false,
   );
   twentynineteen_entry_footer(false);
   ?>
</footer><!-- .entry-footer -->

$post_meta_options = false hides the entire entry footer while

$post_meta_options = array(
   'show_author' => false,
   'posted_on'   => false,
);

adds the ability to render Author and Posted On as per requirement.

#2 @laurelfulford
11 months ago

Thanks for this report, @pratikkry!

@allancole or @kjellr, can you confirm if this is displaying as intended?

@laurelfulford
11 months ago

Twenty Nineteen - post meta on a shorter post.

#3 @kjellr
11 months ago

Can you confirm if this is displaying as intended?

It is, but I see how this is an issue with short posts. I'd be supportive of removing the author and date from the post footers, since it already exists in the header.

@pratikkry
11 months ago

i tried something cool

#4 @laurelfulford
11 months ago

  • Keywords has-patch needs-testing added; dev-feedback removed

#5 @laurelfulford
11 months ago

  • Milestone changed from Awaiting Review to Future Release
Note: See TracTickets for help on using tickets.