Jump to content

Recommended Posts

I am in the process of developing a Wordpress theme, and I'm having difficulties with setting up the pages correctly. Namely, the content of index.php displays on each page, instead of the content corresponding to the page. For instance, the page "Inuit", with the content of "test" in the page admin area, displays posts, rather than the content. The same goes for every other page.

 

Here's index.php:

<?php get_header(); ?>

<?php
$query = new WP_Query(array('posts_per_page' => 6, 'post_type'=>'some_posts'));
while($query->have_posts()) : $query->the_post(); 
the_content();
endwhile;
?>

<?php get_footer(); ?>

And those are the two pages listed in "Pages" in the admin area: Inuit, Test2

 

To clarify, what I'd like is to have the index page display the content AND the posts, and all other pages to display only their own content.

 

 

Thanks in advance for any replies.

Link to comment
https://forums.phpfreaks.com/topic/282767-beginner-wordpress-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.