-
Notifications
You must be signed in to change notification settings - Fork 5
Ways to customize the plugin from your theme
WP Idea Stream is using template parts to include its content in one of your theme's template. The targeted template is page.php
There can be cases where you need to customize the plugin so that it plays nicely with your theme. The first thing that comes to my mind is style
To do so, you only need to :
- Create a
wp-idea-stream
folder at the root of your theme's folder - Copy the
style.css
from the/wp-idea-stream/templates
folder of the plugin - Paste it in the
wp-idea-stream
folder you created at step one and edit the stylesheet from there.
If you're not ok with the plugin to use the page.php template of your theme. You can choose to use a specific template to display the different parts of WP Idea Stream (archive page, taxonomy page, single idea page, user profile).
This specific template needs to be named ideastream.php
. Place it at the root of your theme's folder and it will be the one the plugin will rely on to inject its content.
Be sure to include in this template a regular WordPress loop. To do so you can base this template on your page.php
template, and edit its markup from the ideastream.php
template
There can be cases where you also want to change the markup of the template parts the plugin is injecting in the targeted template of your theme (page.php or ideastream.php).
Here is the list of the plugin's template part is using. You can find them in the /wp-idea-stream/templates
folder of the plugin.
- archive.php : used to list the ideas (regular, sorted, taxonomy)
- idea-loop.php : that's the main IdeaStream loop (used almost everywhere)
- idea-entry.php : that's the template used to display the idea entry in the loop
- idea-header.php : prepended to idea-entry.php and the single idea.
- idea-footer.php : appended to idea-entry.php and the single idea
- idea-form.php : the form to submit new ideas.
- user-profile.php : the user profile template part
- user-comments.php : specific loop to get the comments a user made about ideas. It's the template part used in the user's profile for the "Commented" tab.
- idea-group.php : specific template used to display a single idea within a BuddyPress group.
So to override these templates from your theme, you can :
- Create a
wp-idea-stream
folder at the root of your theme's folder (or use the one you created to override the css file ;) - Copy the desired template parts of the above list from the
/wp-idea-stream/templates
folder of the plugin - Paste it in the
wp-idea-stream
folder you created at step one and edit the template part from there.
You can get latest stable version of WP Idea Stream on its WordPress.org repository