Site logo

Archived topic

Pluginception

13 replies · Started by albabes on November 27, 2016

Viewing posts 1–14 of 14

Still recommending Pluginception Tom? 9 months old, and not compat w/ latest WP.

Thanks

I sorta confused as to how this is used to add to the child theme, functions.php?

Absolutely, all it does it creates a new blank plugin for you to add functions to.

Hey Tom, thanks for answering on Sunday.

Not knowing how plugins work, does your response imply that new plugin data goes on the functions.php file for a child theme?
And if so, what happens when the theme gets an update?

If you're using a child theme, then you can skip creating a plugin and just use the functions.php file.

Creating a blank plugin for your functions and using your child theme functions.php file are the same thing.

Updates won't touch either of them :)

But but but....

/*

It's not recommended to add functions to this file, as it will be lost if you ever update this child theme.
Instead, consider adding your function into a plugin using Pluginception: https://wordpress.org/plugins/pluginception/

*/

Ahh, if you're using one of our WordPress.org hosted child themes, those are updated and changes will be lost.

Instead, use a custom plugin or the Code Snippets plugin.

Are you saying that child themes are different on Wordpress, versus getting them elsewhere? And where is elsewhere?

The GP child themes available on WordPress.org are different in that they receive updates sometimes to fix stuff/add new features.

When themes/plugins are updated, the folder is deleted and the new one uploaded - that's why people lose their changes.

If you use a blank child theme (https://generatepress.com/forums/topic/how-to-install-a-child-theme/#post-198913) - it won't ever receive an update, so it's safe to add your custom functions/styles to.

So since I use Exhibit, I should make a child theme of Exhibit?

Can't have a child theme of a child theme.

You'll need to use a custom plugin or the Code Snippets plugin.

Thanks Tom

You're welcome :)

This archived topic is closed to new replies.