Skip to content

Ways to customize the plugin from your theme

imath edited this page Oct 11, 2014 · 1 revision

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

Overriding the plugin's default css file

To do so, you only need to :

  1. Create a wp-idea-stream folder at the root of your theme's folder
  2. Copy the style.css from the /wp-idea-stream/templates folder of the plugin
  3. Paste it in the wp-idea-stream folder you created at step one and edit the stylesheet from there.

Using a specific template in your theme to display the plugin's template parts

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

Overriding plugin's template parts

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 :

  1. 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 ;)
  2. Copy the desired template parts of the above list from the /wp-idea-stream/templates folder of the plugin
  3. Paste it in the wp-idea-stream folder you created at step one and edit the template part from there.