I am creating a theme, and now I am adding some functionality for my custom post type, such as different metaboxes in post page, extra post config page.
It seems when I try to get the sites theme directory so I can enqueue a custom css file and php file for the seperate post page I am getting FTP root folders in the url, causing it to 404.
Here is the way I am adding it. I have a seperate file with all of the custom post type functions in it, and I am adding it as a dependency through my functions.php. I wanted to go with the separate file, for neatness so I don't have a million functions in my functions.php. I also have a css file in a folder inside of my includes dir. The CSS is for the backend, for the custom post pages in the admin.
EDIT: I just checked and it adds the FTP root info even if I manually add the path instead of a function(get_template_directory()), now this really confuses me as all of the functions anywhere else work fine, just in this file with the post_type functions. I have other post_type functions in my functions.php folder and they work fine too. Anyone care to lend a brain?
When using get_template_directory() :
wp_register_style('PostTypeStyleSheet', get_template_directory() . '/inc/post-types-functions/css/cpadminstyles.css'); wp_enqueue_style( 'PostTypeStyleSheet');
I get a url like this back:
Failed to load resource: the server responded with a status of 404 (Not Found) http://mythemesite.com/home2/jname/public_html/sandbox/wp-content/themes/mytheme/inc/post-types-functions/css/cpadminstyles.css?ver=3.5.1
I am not sure why this is happening, I use get_template_directory() almost everywhere else and do not have this issue. Can anyone tell me why it could be happening?