What is the bare minimum I need to have in a template file for most plug-ins to work?

Discussion in 'WordPress' started by Imozeb, Aug 18, 2010.

  1. #1
    I want to delete everything out of my template files but I want some plug-ins to still work. How do I know what I can delete?
     
    Imozeb, Aug 18, 2010 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    29,002
    Likes Received:
    4,578
    Best Answers:
    124
    Trophy Points:
    665
    #2
    The bare minimum would be to have just index.php - delete the get header, footer, sidebar code. Practically everything can go except for the loop and show contents commands. It'll be the ugliest page on the web but it will work.
     
    sarahk, Aug 18, 2010 IP
  3. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It really depends on the plugins and how they work. Most will not cause any errors but some expect to find certain parts of a template.
     
    Cash Nebula, Aug 18, 2010 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    29,002
    Likes Received:
    4,578
    Best Answers:
    124
    Trophy Points:
    665
    #4
    those widgets won't be happy without a sidebar and you'll probably still need functions.php

    what are you trying to achieve... might be able to give better advice if we know where you're heading.
     
    sarahk, Aug 18, 2010 IP
  5. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I need an empty page in wordpress so I can use php to generate the page completely (header, footer, content). I need to use wordpress so I can use an adsense plug-in.
     
    Imozeb, Aug 19, 2010 IP
  6. sarahk

    sarahk iTamer Staff

    Messages:
    29,002
    Likes Received:
    4,578
    Best Answers:
    124
    Trophy Points:
    665
    #6
    Forget wordpress altogether... adsense isn't hard to add to a page and if you have the php skills to generate a page you have the skills to cut and paste code from the adsense website too.
     
    sarahk, Aug 19, 2010 IP
  7. kiramanic

    kiramanic Peon

    Messages:
    205
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Agreeing with above, but for future reference the bare minimum for a WP theme to work is actually index.php and style.css, as style.css is where WP finds the theme name etc.
     
    kiramanic, Aug 19, 2010 IP
  8. sarahk

    sarahk iTamer Staff

    Messages:
    29,002
    Likes Received:
    4,578
    Best Answers:
    124
    Trophy Points:
    665
    #8
    Indeed! I was thinking more of getting the classic theme and stripping back index.php rather than creating a new theme or of discarding files.
     
    sarahk, Aug 19, 2010 IP
  9. Sokoto

    Sokoto Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    <?php wp_footer(); ?> must be in the footer.php right before </body> while <?php wp_header(); ?> must be in header.php right before </head>. Without these two hooks, most wordpress plug-ins will no function. Please take note
     
    Sokoto, Aug 21, 2010 IP