Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7441257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:58:55+00:00 2026-05-29T10:58:55+00:00

This question has two parts: #1 I have a functions.php that is filled with

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:58:56+00:00Added an answer on May 29, 2026 at 10:58 am

    #1
    Yes, it will. But I recommend you don’t worry about it, because:

    • If your amount of included files is not big it will have really small influence, which won’t be visible at all;
    • There is opcode cache extension for PHP at the hosting, and it will reduce influence of include calls;

    #2
    I prefer to extract all templates into separate phtml files which are stored in separate folder (for example “templates”) and include it when it’s needed. It will increase readability of your functions. For example you will have following code:

    <?php
    function ao_post_meta() {
        include './templates/mycustom-template.phtml';
    }
    ?>
    

    In general my advise is following:

    Try to keep nice/intuitive organized folder/files structure instead of
    putting everything in one file. It will make development and
    maintaining easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two modules A, B. A has a function f() that is globally
This question has been discussed in two blog posts ( http://dow.ngra.de/2008/10/27/when-systemcurrenttimemillis-is-too-slow/ , http://dow.ngra.de/2008/10/28/what-do-we-really-know-about-non-blocking-concurrency-in-java/ ),
This question has been asked before ( link ) but I have slightly different
Scenario: I have a Question which has 2 radio buttons & two subforms: subformA
This question is in two parts: A) Is my design wrong? If so, what
This is a two part question, but first some background information: I have a
Two parts to this question 1) I am working with a group of six
This question has spawned out of this one. Working with lists of structs in
This question has been asked in a C++ context but I'm curious about Java.
This question has been puzzling me for a long time now. I come from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.