get_template_directory has an odd functionality

It is a bug the get_template_directory(); should not return a string that looks like that, try making another installation of WordPress, and echo the get_template_directory(); and see if the output is the same, if it is not then there is something wrong with the first installation.

Include file from higher level

You need to use get_template_directory(), this function will return local server path of you template and then you can use that path to access required file. So in your case it would be something like below: include get_template_directory() . “/Sorting.php”; PS: Mind the spelling of your file.

Organising the plugins folder in wordpress

WordPress has quite narrow expectation for plugin directory structure. It is tightly coupled with loading process and API functions. While I know attempts have been made to make it more flexible, I am not aware of any real breakthroughs or mainstream adoption. As of current state of core I would estimate you would waste more … Read more

Loading files for theme and child theme (Require)

get_theme_file_uri(), get_theme_file_path(), get_parent_theme_file_uri() and get_parent_theme_file_path() are relatively new (introduced in WordPress 4.7) functions that have a couple of significant advantages over using get_template_directory(). get_theme_file() and get_theme_file_path () allow you to reference files in your theme in a way that allows them to be replaced by a child theme. This lets you do things like allow … Read more

WordPress multisite subdirectory on nginx behind reverse proxy

The problem was the sql database that did not update urls. I do not know if there is a way to do this easily but I feel like I have looked everywhere for this solution and finally found it with this answer to a somewhat similar question : https://premium.wpmudev.org/forums/topic/how-to-change-url-for-wp-multi-site#post-426799 I started over from where everything … Read more

Custom post types with custom directories

Is something like this possible without running MultiSite (which I believe would force the blog to live at blog.domain.com)? Not quite. There are two basic modes multisite installation can operate in: sub-domains ( site.domain.com ) sub-directories ( domain.com/site ) As far as I remember in subdirectory installation main blog is also forced to have /blog/ … Read more