Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

bouinfrederic on "query_posts alternative"

$
0
0

Hi there,

I am creating a website that integrates a portfolio which uses custom post types, this was done based off of this tutorial.

So far it is exactly what I am looking for and works great except for one small detail. In order to fetch the posts from the new custom post type the author of the tutorial used the query_posts() codex. So the top of my portfolio page looks like this:

<?php
/* Template Name: Portfolio */
get_header();
query_posts('post_type=portfolio&posts_per_page=10');
?>

What I gather is that this declares "get posts from "post type" portfolio and show 10 per page". My problem is that I can't go get content from my portfolio page. It seems that now my portfolio page only fetches the content from the custom post type, and I can't use:

<?php while ( have_posts() ) : the_post(); ?>
  <?php the_content(); ?>
<?php endwhile; // end of the loop. ?>

to get content from the actual page.

Any ideas how I could modify this? I am also still learning so being clear with explanations would be greatly appreciated.

Thank you!


Viewing all articles
Browse latest Browse all 8245

Trending Articles