Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter TikiKitchen

    (@tikikitchen)

    Here is the Gist the one above does not work.

    https://gist.github.com/eeb7c7e13a15f9aa3e0f.git

    Plugin Author mrwweb

    (@mrwweb)

    THanks for all this, @tikikitchen.

    Here’s a working link to the gist: https://gist.github.com/TikiKitchen/eeb7c7e13a15f9aa3e0f

    This is all very helpful!

    Some new questions:

    1. Is this a particularly large site?
    2. Have you tried to change anything about the plugin using filters or template files?
    3. What version of PHP are your staging and local environments using?
    Thread Starter TikiKitchen

    (@tikikitchen)

    1. Define large. This is a publication site, so yes it can be pretty unweildy just as a Dev/stage environment (the DB is about 250MB).

    2. I have a templates folder in my theme, but I have not changed anything to the plugin directly.

    3. The stage environment is PHP Version 5.5.19. My local is PHP Version 5.6.10, so there is difference there.

    Plugin Author mrwweb

    (@mrwweb)

    Can you try out the following snippet (Functions, plugin, whereever)?

    add_filter( 'fpw_post_types', 'fpw_add_post_type_to_feature' );
    function wp7256101_fpw_remove_posts( $post_types ) {
    	unset($post_types['post']);
    	return $post_types;
    }

    Feature a Page Widget 2.0 includes Pages AND Posts in the default Page to Feature list. I’ve never been able to confirm, but I’ve had a suspicion that too many posts can break that select list just from running out of memory. If I’m right, that would probably “fix” it.

    Thread Starter TikiKitchen

    (@tikikitchen)

    Okay. That makes sense.

    I added the snippet to functions.php, and here are the warnings I get:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘fpw_add_post_type_to_feature’ not found or invalid function name in /home/cartoonb/public_html/dev/wp-includes/plugin.php on line 213

    Warning: Invalid argument supplied for foreach() in /home/cartoonb/public_html/dev/wp-content/plugins/feature-a-page-widget/inc/fpw_init.php on line 107

    Note WP_DEBUG is set to true.

    Thread Starter TikiKitchen

    (@tikikitchen)

    But yes. It worked!

    Mahalo nui loa for your help. I want to donate to this plugin.

    Plugin Author mrwweb

    (@mrwweb)

    I’m an idiot. Here’s the code snippet to try so you don’t get those errors.

    add_filter( 'fpw_post_types', 'wp7256101_fpw_remove_posts' );
    function wp7256101_fpw_remove_posts( $post_types ) {
    	unset($post_types['post']);
    	return $post_types;
    }

    I think that should work. As long as you don’t need to feature posts, then I think that solves your problem. In the future, I’ll need to think about how I can resolve this issue without the extra snippet.

    Thanks for the offer to donate! You can either support the organization ByteBack through the donate link on the wp.org plugin homepage or just send me a personal donation at https://cash.me/$mrw.

    Thread Starter TikiKitchen

    (@tikikitchen)

    Actually, I need this to feature posts, and not pages. I’ll tinker with this, but if I can’t feature posts then I need to rethink this section.

    I do thank you for your help.

    Plugin Author mrwweb

    (@mrwweb)

    Well shoot! You can try the same snippet with 'page' instead of 'post' in line 3. It may have the same effect depending on the number of pages, posts, and the server’s memory.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘FPW Not breaking Widgets Page’ is closed to new replies.