Make WordPress Core

Opened 5 years ago

Closed 4 months ago

#45555 closed defect (bug) (wontfix)

Twenty Nineteen: Remove duplicate meta info on single post

Reported by: pratikkry's profile pratikkry Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0
Component: Bundled Theme Keywords: has-patch needs-testing close 2nd-opinion
Focuses: Cc:

Attachments (2)

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

Download all attachments as: .zip

Change History (9)

#1 @subrataemfluence
5 years 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
5 years ago

Thanks for this report, @pratikkry!

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

@laurelfulford
5 years ago

Twenty Nineteen - post meta on a shorter post.

#3 @kjellr
5 years 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
5 years ago

i tried something cool

#4 @laurelfulford
5 years ago

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

#5 @laurelfulford
5 years ago

  • Milestone changed from Awaiting Review to Future Release

#6 @poena
4 months ago

  • Keywords close 2nd-opinion added

Removing this meta information now, so long after release, would be an unexpected change for existing users of the theme.

Because of this, I recommend closing the ticket.

#7 @sabernhardt
4 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I do not like the duplication, but I agree about closing the ticket. Some people may want to remove links from the header, others from the footer, and some people may like all the links where they are. The Core team probably should not make that decision for everyone using the theme.

Note: See TracTickets for help on using tickets.