Wordpress:从模板中的帖子编辑日期,作者和其他内容

I am using the Generate Press template and I want to customize the post page. I modified single.php, so I could change the CSS and PHP. Though, what I'm hoping to do is be able to change the order of appearance of the author's name, the date, and the content.

  <main id="mein" <?php generate_main_class(); ?>>
    <?php do_action('generate_before_main_content'); ?>
    <?php while ( have_posts() ) : the_post(); ?>

      <?php get_template_part( 'content', 'single' ); ?>
          <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#demo">Simple collapsible</button>
       <div id="demo" class="collapse">
        <?php
            // If comments are open or we have at least one comment, load up the comment template
            if ( comments_open() || '0' != get_comments_number() ) : ?>
                <div class="comments-area">
                    <?php comments_template(); ?>
                </div>
        <?php endif; ?>
      </div>
    <?php endwhile; // end of the loop. ?>
    <?php do_action('generate_after_main_content'); ?>
    </main><!-- #main -->

I cant find in the code any place to change this. I can only modify this as a group. Also, I am new to PHP.

Any suggestions?

The author, date and time posted are post meta items, and would be found in the post-meta.php file.

Look for the function generate_posted_on() around line 111 (but may differ, depending on version, I just downloaded the latest version to find it, but yours may vary)

For additional reference, the code that calls its parent function (generate_post_meta) is found in numerous places, but for your requirements, start with content-single.php.

/**
* The template for displaying single posts.
*
* @package GeneratePress
*/

one simple method,

<?php get_template_part( 'content', 'single' ); ?>

This code is loading the template part of content.php. so, find content.php inside your theme folder, and copy all the code from content.php and replace the above snippet

so that you can edit author, date and whatever you want.

Make sure you only replace snippet with the entire code of content.php in your press-template