Problem with loop
-
Hello,
I have a custom template loaded on a wordpress page. The Custom template loads in a custom post type query loop:
[please review http://codex.wordpress.org/Forum_Welcome#Posting_Code for posting code in the forum]
<?php $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query('showposts=10&post_type=test'.'&paged='.$paged); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <li> <?php the_title( '<a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a>' ); ?> </li> <?php endwhile; wp_reset_query(); ?>In the functions.php is a special custom post type based on test created.
The problem is: When I fill in the page title and content WYSIWYO editor it doesn’t loop this content.
Im using a general page loop to show this content after the custom post type loop has ended:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h1><?php the_title() ;?></h1> <?php the_content(); ?> <?php endif; ?>The second general page loop will still take the loop content of the first loop with content of test instead of the content I typed in the general page.
I hope someone can help me with this issue.
The topic ‘Problem with loop’ is closed to new replies.