epdahl90wp
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Print out all pages of my siteI tried the new code and it produced nothing different. However upon inspecting the code in my browser I saw that it was coming from page 163 so I simply added it to the post__not_in array and it’s gone. Couldn’t find what that page was but doesn’t matter if I can’t see it.
Thanks for all of your help you’ve been great!Forum: Themes and Templates
In reply to: Print out all pages of my siteYes this works great. Just want to post the full code up if anyone else needs it in the future.
<?php $args = array( 'post_type' => array( 'page' ), 'post_status' => array( 'publish' ), 'orderby' => 'parent', 'order' => 'asc', 'posts_per_page' => 900, 'post__not_in' => array( 181, 21, ) ); query_posts( $args ); if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="postWrapper" id="post-<?php the_ID(); ?>"> <h3 class="postTitle"><?php the_title(); ?></h3> <div class="post"> <?php the_content(__('(more...)')); ?> </div> </div> <?php endwhile; else: ?> <p>Sorry, no pages matched your criteria.</p> <?php endif; ?>The only problem is that it is now displaying the words “Auto Draft” as a h3 post title after all of the main parent pages. Not sure where this is coming from or why it’s suddenly showing up.
Forum: Themes and Templates
In reply to: Print out all pages of my siteThanks that pointed me in the right direction. Here is what I have now.
<?php query_posts('post_type=page&orderby=parent&order=asc&posts_per_page=900&post_status=publish'); if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="postWrapper" id="post-<?php the_ID(); ?>"> <h3 class="postTitle"><?php the_title(); ?></h3> <div class="post"> <?php the_content(__('(more...)')); ?> </div> </div> <?php endwhile; else: ?> <p>Sorry, no pages matched your criteria.</p> <?php endif; ?>I tried to order by menu_order but since the parent pages are on their own menu_order number and the child pages all have their own numbers it reads it as having ten different pages with menu_order 1 instead of respecting the parent structure. Currently it’s using the orderby “parent” command which groups up the child pages correctly but doesn’t group the parent page with them. If there is a better way to order this let me know.
The other idea I had is to change the menu_order on all the pages and number them 1-45 for each page. The problem with this is if I decide to add a page down the line I have to change every page after it in the sequence. This would make the orderby menu_order command work though.
Last question – I need to exclude the “All pages” page from the list along with a few others. I can’t figure out how to exclude multiple page id numbers.
Forum: Your WordPress
In reply to: Dynamic Indie Music BlogThat’s a good point. It doesn’t say music blog anywhere clearly. I think I’ll add that to the header. Thanks for the feedback!