I’m working on a pro bono project to try to learn WordPress. I’ve been provided with a rough design (see screenshot below) and I’m struggling trying to think of how to approach the issue.

My main issue is the whole image gallery side of it. In order to make it so that my client can take the site and not have me create the content in the future I feel like I will have to develop a plugin to make it look/function.

I’ve searched for other plugins that are like this but nothing quite does what I need it.

website design

I guess I’m mostly looking for guidance on what my next steps should be for this.

2 s
2

Try to keep the business logic out of the theme. Dealing with images is always an edge case, because they do affect presentation, which is usually a theme job.

But the logic of how to get and order these images, the JavaScript parts and the backend are probably better in a separate code base. That is also easier for version control, because you can focus on one problem that is complex enough already.
I would just add a custom action to the theme, maybe like this:

do_action( 'content_before' );

See ticket #21506 for a discussion of standard theme hooks.

Your plugin could then insert its content with:

add_action( 'content_before', 'your_plugin_callback' );

Provide a separate stylesheet, but offer an option for themes to override that per add_theme_support().

And the best thing is: you can reuse the code in the next project if you keep it flexible enough. Or share it on wordpress.org. Or sell it.

See also: Where to put my code: plugin or functions.php?

Leave a Reply

Your email address will not be published. Required fields are marked *