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.

I am trying to extend the first serious plugin that I am building. I'd like to be able to use it with different sites/templates.

At the moment I designed a custom page that I included with the plugin that outputs a bunch of data that is edited through the plugin. I built 1.0 of this so it looked fine with the theme that was being used while I built the template.

But when I tried using a new theme everything got messed up (I kind of expected that to be honest).

To help answer the question my approach has been the following with this page:

<?php
/*
Template Name: Football Game (Single)
*/
get_header(); ?>

<div id="main">
    <div id="post-area">
     Custom content here 
    </div><!--post-area-->
</div><!--main -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

This looks fine on the original template I was developing for, but on the new template (Twenty Fourteen), the nav on the left covers it up, and the nav has no menu items anymore.

I am simply looking for a technique/approach/methodology to make plugin content display nicely in a variety of templates.

share|improve this question
    
The answer depends a lot on where in the page the plugin data is supposed to show up. And, honestly, I am not sure there is anything 100% bullet-proof that you can do to prevent themes from messing things up. –  s_ha_dum Jan 14 at 17:55

1 Answer 1

It's probably messed up cause the CSS styles doesn't conform to the other theme's styles.

As far as I understand your question, I would suggest to send the data in a custom shortcode and post that to the page's content editor field. You can load a custom style for the output with the plugin.

Hope that helps.

share|improve this answer
    
Hi Matthias, thank you for responding. I was thinking about a shortcode. The problem is this template displays the next upcoming 10 football games, and when you click on one of the football games it displays more info. So in a way there is a 'games' page and a 'game' page. I see how it is possible to list the games as a shortcode, but the specific game page, I'm not sure how this will work. –  fakeguybrushthreepwood Jan 14 at 18:03

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.