This question has two parts:
#1
I have a functions.php that is filled with functions. I have to scroll to find the function I want, and even with comments to delineate where one ends and the next begins, it's sometimes difficult to find what I want.
I have broken up the functions into individual PHP files and used, for example, include_once 'assets/functions/author_list.php';
to make the functions.php file much cleaner.
So the first question is: will using multiple includes
in functions.php slow down load time or affect site performance on the front or back end?
#2
Second question is similar. If I have a function such as the following in functions.
<?php
function ao_post_meta() {
?>
<div class="post-meta">
<time datetime="<?php the_time('Y-m-d'); ?>"><?php the_time('M j, Y'); ?></time>
<?php if('videos' == get_post_type(get_the_ID())) { ?>
<a class="author-link" href="<?php bloginfo('wpurl'); ?>/character/<?php echo get_the_author_meta( 'user_nicename' ); ?>">
<span><?php the_author(); ?></span>
</a>
<?php } else { ?>
<a class="author-link" href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>">
<span><?php the_author(); ?></span>
</a>
<?php }?>
<a class="comment-link" href=""><?php echo get_comments_number(); ?></a>
</div>
<?php
}
?>
Is it better to simply put that in a separate PHP file, my-post-meta.php, and use include(my-post-meta.php) in my template rather than calling it as a function?
Thanks!