Getting out side of wp root folder from function.php using absolute path

If you want the absolute path to your theme’s stylesheet directory you could use get_stylesheet_directory(). If you want the URI of your theme’s stylesheet directory you could use get_stylesheet_directory_uri(). get_theme_root() will return the absolute path to the themes directory. get_home_path() will return the absolute filesystem path to the root of the WordPress installation. Once you’ve … Read more

Creating custom post type posts and associating them with a post from another custom post type

Taken literally your question is about post to post relationships. Bad news — WordPress core doesn’t do post to post relationships. However there are some solutions ranging from frameworks like Posts 2 Posts to plugins like Post Connector. Stepping a bit back though, structure you are describing strongly implies grouping of posts. The mechanism for … Read more

Include drafts in internal link dialog

This is very similar to this question. We have to hook into check_ajax_referer to address the internal linking feature only. Then we register an action for pre_get_posts to extend the search to drafts and pending posts. We will still get no pretty permalinks, because they are excluded in get_permalink. So we register a filter for … Read more

Assets in css dont link properly in pages other than home

You’re using relative URLs that will always look inside the current URL structure. You either need to add a slash before wp-content, or put in the full URL to the resources. So for example: src: url(‘/wp-content/themes/mytheme/fonts/font.ttf’); or src: url(‘http://example.com/wp-content/themes/mytheme/fonts/font.ttf’);