WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] Strange behavior with Post 2 Post (5 posts)

  1. smeyer012
    Member
    Posted 2 years ago #

    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/

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. smeyer012
    Member
    Posted 2 years ago #

    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.

  4. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    You really need to get a hold of that fatal error.

    A) Look for error log files
    B) Add this file in your wp-content/mu-plugins directory (create the dir if it's not there).

  5. smeyer012
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic