I think you’re taking the hard route, the better way would be looking at the jQuery accordion and finding a way to make the changes stick between pages. You could do this by letting it place a cookie remembering the previous state which it then picks on the next page load.
What specific accordian are you using (since there are a billion of them), you may find it better to alter that then loading wordpress in an iFrame.
Thanks Indeedle. But I’m about to throw a wrench into your suggestion. I don’t code. I don’t know jQuery or javascript or java or PHP or any programing language. None.
I choose the hAccordian I found at http://letmehaveblog.blogspot.com/2007/10/haccordion-simple-horizontal-accordion.html (note: my browser tells me this is an attack site, but I know its not.) because its baby simple and it uses <div> and not
ul for its panels (that is important to me) and it will take percentage heights and widths (also important to me).
Again, if there is a way to fool wordpress into acting like there is a iframe there, I’m fine with that too. But I can’t code that. I think this would be a lot easier if I could just get wordpress to load its pages into one <div>. Like some sort of PHP command that said “WordPress, load all files in this div.” Then I could put the loop in there everything would be fine. Problem solved.
Thanks again.
The problem is that the files you’re trying to load (yourtheme/index.php, for example) can’t be loaded directly. In general (with some rare exceptions like the login page), WordPress doesn’t work by directly accessing files like that–those are TEMPLATE files that should only be accessed by WordPress itself. Know what I mean?
If you want to create a single php file that makes available WordPress functions (like queries and a loop), you have to do what’s called “bootstrapping” WordPress–loading up the WordPress framework that does all that website-generating magic–then manually creating a query for your loop to use.
Try putting the following code into a file, then save it as “news.php” in the root of your WP install (alongside wp-login.php, wp-config.php etc.).
<?
// Bootstrap WordPress. This makes most WP functions availabe to you now.
require( 'wp-load.php' );
// Your php file is out on its own here, so you need to manually create a query. You can find more about queries and the arguments they accept here: http://codex.wordpress.org/Function_Reference/query_posts
$args = array(
'post_type' => 'post'
);
query_posts($args);
// Begin the loop, just like you normally would.
while ( have_posts() ) : the_post();
?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mastercard' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div>
<?php the_excerpt(); ?>
</div>
<? endwhile; // end of loop ?>
Now you can call this file directly (yoursite.com/news.php), and it’ll load up a basic loop.
Hope this helps.