Title: [Plugin: Posts 2 Posts] Strange behavior with Post 2 Post
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] Strange behavior with Post 2 Post

 *  Resolved [smeyer012](https://wordpress.org/support/users/smeyer012/)
 * (@smeyer012)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-posts-2-posts-strange-behavior-with-post-2-post/)
 * Hello,
    I am trying to use Elegant Theme’s “Envisioned” theme as a parent theme
   for a client’s site with Posts 2 Posts. I have a starter theme that I usually
   use as the basis for projects (a code base of sorts). When I learned of the Posts
   2 Posts plugin, I tried it in my starter theme and everything worked as expected,
   so I intended to use it for this project. The P2P plugin, when used with the 
   Envisioned theme works normally. When I try to use it with my child theme, the
   plugins page (only) displays the white screen of death (other admin pages are
   fine). The culprit appeared to be in the functions file of the child theme, so
   I commented out all functions and reintroduced them one by one. I was able to
   narrow it down to the function that I use to display subpages and my employee
   custom post type (require_once). What’s strange is that these lines of code are
   identical to my starter theme’s function file. Even stranger, I moved two functions
   below the subpages function within the child theme’s functions file to make it
   exactly the same as the starter theme. Then I followed a similar comment/uncomment
   testing scenario and found that I was able to get it to work with subpage function
   uncommented but with the require_once for the employee post type and the require_once
   for the file that creates a “global info” (tagline, phone #, etc) options page
   in the admin commented out. I was able to keep the options page require_once 
   uncommented before. This leads me to believe that it’s not the exact code that’s
   creating the issue. Unfortunately, it also leaves me not having a clue of what
   the problem is. I am writing Elegant themes too, but I was hoping that someone
   might have some insight into this issue. Thanks. -Steph
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-posts-2-posts-strange-behavior-with-post-2-post/#post-2707628)
 * > When I try to use it with my child theme, the plugins page (only) displays 
   > the white screen of death (other admin pages are fine).
 * So, you mean `wp-admin/plugins.php`, right?
 * Add `define( 'WP_DEBUG', true );` to your wp-config.php file. You should see 
   a “Fatal error:” message instead of a WSOD.
 *  Thread Starter [smeyer012](https://wordpress.org/support/users/smeyer012/)
 * (@smeyer012)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-posts-2-posts-strange-behavior-with-post-2-post/#post-2707636)
 * I still just get a white screen.
    This is extremely bizarre. I was able to get
   an error message, without the “require_once” lines commented out, which pointed
   to an error with a different function (used to add a metabox to a page template…
   the indicated line is being used to retrieve the post ID…I’ve checked my method
   against other documented methods and the code is fine). Commenting the whole 
   function didn’t resolve the WSOD problem, it just got rid of the warning. Now
   I can’t seem to replicate the error…just a big ol’ WSOD.
 * I’ve used this same code before along with other plugins and had no problems.
 * I tried adding require_once with a blank php file (just open and closing tags)
   and no WSOD. Then I dropped in the create post type function:
    ` function create_emp_post_type(){
   register_post_type( 'employees', array( 'labels' => array( 'name' => __( 'Employees'),'
   singular_name' => __( 'Employee' ), 'add_new' => __( 'Add Employee' ), 'add_new_item'
   => __( 'Add Employee' ), 'edit_item' => __( 'Edit Employee' ), 'new_item' => 
   __( 'Add Employee' ), 'view_item' => __( 'View Employee' ), 'search_items' =>
   __( 'Search Employees' ), 'not_found' => __( 'No Employees found' ), 'not_found_in_trash'
   => __( 'No Employees found in trash' ) ), 'public' => true, 'rewrite' => array('
   slug' => 'employee'), 'show_in_nav_menus' => false, 'hierarchical' => true, '
   supports' => array( 'title', 'editor', 'thumbnail' ) ) ); } add_action( 'init','
   create_emp_post_type' );
 * and then I got the WSOD. This is pretty straight forward. I can’t figure out 
   what the problem is.
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-posts-2-posts-strange-behavior-with-post-2-post/#post-2707637)
 * You really need to get a hold of that fatal error.
 * A) Look for error log files
    B) Add [this file](https://gist.github.com/625769)
   in your `wp-content/mu-plugins` directory (create the dir if it’s not there).
 *  Thread Starter [smeyer012](https://wordpress.org/support/users/smeyer012/)
 * (@smeyer012)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-posts-2-posts-strange-behavior-with-post-2-post/#post-2707661)
 * So I was able to get an error for a separate plugin that is not in the starter
   theme files. It was a memory limit error for the Admin Menu Tree Page View plugin.
   So I disabled it and everything seemed to work fine thereafter. I know the memory
   limit error is an issue with the server configuration, and I was working on MAMP(
   local server) while making the child theme…since re-uploading the site to our
   demo server, I’ve been able to reactivate the Admin Menu Tree Page View plugin
   and haven’t encountered a nasty WSOD yet. Let’s hope that was it.
 * Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Posts 2 Posts] Strange behavior with Post 2 Post’ is closed 
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [smeyer012](https://wordpress.org/support/users/smeyer012/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-posts-2-posts-strange-behavior-with-post-2-post/#post-2707661)
 * Status: resolved