Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

So, I consider myself a "advanced novice" at WordPress development but I still do not have the concept of pages and templates fully understood. I'm having an issue with a feature I'm attempting to include in my plugin and discovered that it's possibly due to the way I am displaying my interfaces on the pages (via shortcodes). Without customizing a theme, how would one display interfaces (grid with interactive functionality) on the font-end? The way my plugin works currently is that it uses shortcodes to house all of my php code that performs the work to display my interfaces and those shortcodes are added as content to pages that my plugin creates upon activation. Is there another way to do this?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

What you're doing is, in my opinion, the best way to accomplish this. First off, the pages are a good way to go, because they give users the ability to customize parts of the page like title, meta fields, etc. You don't have to use shortcodes per se, you can filter the_content for these pages, but shortcodes offer additional flexibility. For instance, your users can call them directly in a template file if they don't want to use pages, or they can use them in other posts if they want to use a custom post type or something. Anyway, nice work, this is a great way to go. That doesn't solve your issue, but you can probably cross it off your list.

share|improve this answer
    
Many thanks for the info. Helps to know that all the thousands of lines of code I've written are not in vain. I'll keep the course with the shortcodes. My next question is, I have forms on those shortcodes that get POST'ed and I capture the POST'ed data and save it to the database. BUT, once I'm done with the database, I would like to automatically redirect the user back to what I call the "dashboard". When I try to do a wp_redirect after the POST, I get the Warning about the Headers already being sent. Do you know of a way around this? –  ClockwiseQ May 26 '13 at 3:52
    
As a quick guess, I'd say you're trying to run the redirect too late in the request chain. Check out the Action Reference which shows you a typical request chain. You should catch the POST data before send_headers. The init action is perfect. If that doesn't help, it's best to open a separate question and try to provide as much detail as possible! –  Matthew Boynes May 26 '13 at 4:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.