bcswebstudio
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Broken pages implementationSolution!
After reading the wp docs on The Loop to explain the above discovery, I came up with this:
the_post(); rewind_posts();
which goes somewhere before the “global $id;” in my above-above code snippet. I don’t know how efficient this is, but it works (for now?)Forum: Fixing WordPress
In reply to: Broken pages implementationMore info on the topic:
By placing my sub-page iteration in page.php before the line:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
it breaks, but immediately following the above line, it works. Something about that line seems to set $id for me…Forum: Fixing WordPress
In reply to: Broken pages implementationjshepard- did you ever get it?
My test wp installation works fine until I try to include subpages in the header.php template. Only slightly modified from the wp docs comments on wp_list_pages(), here is my offending code:
<?php if (is_page()) { ?>
<div id="subpagemenu">
<?php
global $id;
wp_list_pages('child_of=' . $id . '&title_li=<h2>Sub Pages</h2>');
?>
</div>
<?php } ?>
I get:
Warning: Invalid argument supplied for foreach() in /mypath/wp-includes/template-functions-post.php on line 378Taking out that snippet for listing subpages remedies the noise.