Title: Theming without a Theme
Last modified: August 19, 2016

---

# Theming without a Theme

 *  [limne](https://wordpress.org/support/users/limne/)
 * (@limne)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theming-without-a-theme/)
 * So, I’ve been working on trying to integrate my website and blog (I’m not using
   a theme because most of the site’s content is going to be non-WordPress dynamic
   php stuff). It’s just starting to work. The WordPress header is included at the
   top of my index page and whenever a visitor is in my site’s home section a php
   file containing the loop (nearly identical to the default theme’s index) and 
   post formatting is called up between my own header and footer. This is all well
   and good, but I’m not getting all my posts, nor do my post’s links seem to do
   anything but reload the same content.
 * Thus, I’m wondering whether I can get all the functionality of a theme by using
   my WordPress blog as an include. If I understand everything the Codex has said
   about Themes and the loop, specifically I’m wondering if it will be possible 
   for me to use templates (Just as though I was using a theme) but to store them
   in a non-Wordpress directory. Could something like this work?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [limne](https://wordpress.org/support/users/limne/)
 * (@limne)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theming-without-a-theme/#post-1442018)
 * Let me take a stab at this and guess that what I want is impossible and that 
   the entire WP architecture can’t be inserted into a preexisting website as some
   sort of plugin with all the functionality of a WP theme. It really would have
   been nice to have been warned of such things by the Codex…
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theming-without-a-theme/#post-1442020)
 * I think it’s possible, but you sure worded yourself in a convoluted way 🙂
 * First off, no matter what, you ARE using a theme for WordPress. Full stop. That’s
   just what it is. Accept it 😉 Now you can over-ride that theme, but it’s still
   there.
 * Also, what sort of ‘non-Wordpress dynamic PHP stuff’ are we talking about? You
   may want to just match your WP theme to that theme, and not worry about it, or
   use custom page-templates inside your WP install to call the special PHP stuff
   you want. But without details, I can only say this: what you want SOUNDS possible.
 * I have an index.php page like so:
 *     ```
       <?php
       /* Short and sweet */
       define('WP_USE_THEMES', false);
       require('./wp/wp-load.php');
   
       ?>
       ```
   
 * That loads my WordPress functionality. Then I have my CSS and my whatnot loaded.
   I DON’T load the header, because I wanted a special CSS setup and it was easier
   this way.
 * Below the PHP call I have my basic HTML, and then I have more PHP for the loop
   to call my posts. So yes, you can have the WP stuff included in an external page.
 *  Thread Starter [limne](https://wordpress.org/support/users/limne/)
 * (@limne)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theming-without-a-theme/#post-1442023)
 * > I think it’s possible, but you sure worded yourself in a convoluted way 🙂
 * Did I? I tried my best to explain in simple terms, but this whole thing is turning
   out to be very complicated.
 * > Also, what sort of ‘non-Wordpress dynamic PHP stuff’ are we talking about?
 * Mostly various image browsers and various kinds of customized sidebars for jumping
   between images and pages within them. So far I haven’t had much luck getting 
   the plugins to do what I’d like them to so I’m reworking PHP a friend wrote for
   me a few years back.
 * > I have an index.php page like so…
 * It seems you really didn’t understand my initial post. To recap: I’d already 
   done everything like you’ve said. Both that snippet of code (for the WordPress
   Header) and the loop are already included and working properly. _However,_ they’re
   severely limited in what they can do in this environment:
 * Clicking on a permalink will not take you to it’s own page. Clicking a tag or
   category link will not take you to its respective archive page. All links simply
   reload the page, including the one’s I need to access older content. Now, as 
   I understand it, these pages are usually handled by different templates in the
   themes folder. Because I have theme’s disabled, WP can’t access them and doesn’t
   know where to look for these templates, and so it simply reloads the index.php
   file which is limited to showing a few of the most recent posts.
 * Thus, I am wondering how I can get the rest of my content (as if through archive
   templates) to load.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theming-without-a-theme/#post-1442024)
 * You didn’t mention HOW you did your integration, so I gave you the basic ‘this
   is how we do it’ Always assume the worst 🙂
 * > Clicking on a permalink will not take you to it’s own page. Clicking a tag 
   > or category link will not take you to its respective archive page. All links
   > simply reload the page, including the one’s I need to access older content.
 * I don’t have that problem. So I can only assume this: You coded your loop in 
   a weird way.
 * My permalinks all take me to the post’s pages.
 * The far easier thing to do here would be to make your theme for WordPress match
   your site, and then call the loop to link to those normal WP pages.
 * > Mostly various image browsers and various kinds of customized sidebars for 
   > jumping between images and pages within them.
 * You can put the PHP into WordPress, you know, rather than the other way around.
   Put the PHP in your theme and it would act, somewhat, like your own plugin. I
   think that while you could strong-arm WP into working your way, you might want
   to shoot yourself by the end of it. 🙂
 *  Thread Starter [limne](https://wordpress.org/support/users/limne/)
 * (@limne)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theming-without-a-theme/#post-1442037)
 * > You didn’t mention HOW you did your integration, so I gave you the basic ‘this
   > is how we do it’ Always assume the worst 🙂
 * It’s cool 🙂
 * > I don’t have that problem. So I can only assume this: You coded your loop in
   > a weird way.
 * Hmm… The only tag I can think of that might be responsible is this one: `<?php
   query_posts('showposts=2');?>` It’s inserted just before the `<?php if (have_posts()):?
   >` tag at the start of the loop. I saw it used in one of the tutorials I found
   online. Do you know what it does?
 * > You can put the PHP into WordPress, you know, rather than the other way around.
   > Put the PHP in your theme and it would act, somewhat, like your own plugin.
   > I think that while you could strong-arm WP into working your way, you might
   > want to shoot yourself by the end of it. 🙂
 * Hmmm… That might work. I’d only thought of using WP pages before, but I guess
   there really isn’t a reason I can’t pile all my own content into the theme’s 
   folder and have it called up as includes. I guess I’m just worried about if the
   php might mesh right (Maybe if there are variables, arrays and functions, etc.
   with the same name). Do you know of cases where people have been successful in
   doing it this way?
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theming-without-a-theme/#post-1442052)
 * `<?php query_posts('showposts=2');?>` should be limiting the number of posts 
   to 2.
 * > I guess I’m just worried about if the php might mesh right (Maybe if there 
   > are variables, arrays and functions, etc. with the same name). Do you know 
   > of cases where people have been successful in doing it this way?
 * I know of theoretical cases, but my personal experience here is limited to the
   theory. It would greatly depend on the specifics at this point. I mean, there
   are a LOT of image gallery plugins, or external image galleries that can hook
   into WP (see Zenphoto for example). As a matter of fact, Zenphoto has a thing
   called Zenpage which simulates WordPress.
 * It’s a matter of the right tool for the job 🙂 I’m stabbing in the dark a bit,
   since I’m not really sure what plugins you’ve tried and how they failed to meet
   your expectations/desires.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Theming without a Theme’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [templates](https://wordpress.org/support/topic-tag/templates/)
 * [the-loop](https://wordpress.org/support/topic-tag/the-loop/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)
 * [website](https://wordpress.org/support/topic-tag/website/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/theming-without-a-theme/#post-1442052)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
