I will update Premium Account on this website Shareaccounts.org

To call a PHP file in a WordPress theme, you can use the get_template_part() function.

The get_template_part() function is used to get the PHP file specified in the theme directory. It is used to load another template file in the WordPress theme, which allows you to better organize and reuse your theme files.

Get_template_part() function usage reference: Detailed usage of get_template_part function in WordPress

The get_template_part() function has two parameters:

$slug: used to specify the name of the template file to be loaded, which can contain subdirectories but does not need to contain the file extension. If you need to load a template file named header.php in the root directory of the theme, you can use $slug = ‘header’.
$name (optional): used to specify a more specific name to distinguish different template files. If there are other variations in header.php, such as header-home.php, header-blog.php, etc., you can use the $name parameter to load these variations. If you do not need to distinguish different template files, you can omit the $name parameter.
Let’s look at some examples:

Load the theme’s header.php file:

get_template_part( ‘header’ );
Load the theme’s header-home.php file:

get_template_part( ‘header’, ‘home’ );
Load the theme’s partials/sidebar.php file:

get_template_part( ‘partials/sidebar’ );
Load the theme’s content.php file and pass some variables:

$post_type = get_post_type(); get_template_part( ‘content’, $post_type );
It is important to note that the get_template_part() function automatically loads a specific template file related to the current page. For example, in a single post page, if the $slug and $name parameters are not specified, the single.php file is loaded by default. In a category page, the category.php file is loaded by default. Therefore, the get_template_part() function can help you easily write more flexible and reusable WordPress theme code.