adding a custom text box to a theme via plugin
-
i’m trying to develop a very simple plugin to add a “shout” box in a theme, to get a less boring home page. Basically i have a custom post type called “shout box”, that should let people to write some text and this text should appear just under the navigation menu, in home page. So when we launch the site this written could be “hey, this is our new site”, but could easily changed to “check out our new projects”.
i managed it modifying a template inserting this:
<div class='shoutbox'> <?php while($custom_shoutbox_posts->have_posts()) : $custom_shoutbox_posts->the_post() ?> <?php $custom_shoutbox_message= get_the_content(); print $custom_shoutbox_message; ?> <?php endwhile ?> </div>
this is (quite) good.. but is there a way to add this to any theme? now, if i change theme, i must modify the new homepage template..
the problem is that i don’t know which function, action and hook to choose to make this more generale and less ‘template-dependant’thanks
- The topic ‘adding a custom text box to a theme via plugin’ is closed to new replies.