WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a wordpress CMS and I have added multiple pages under one parent page. I am generating the links for all the child pages of a page and then when user clicks on the links, they should be able to open the child page. How ever when I click on the links, the index page is opened and no child page content is displayed. May be it is due to the use of the .htaccess file. I dont have any knowledge of htaccess. Any help?

            $pages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) );

            foreach ($pages as $page) {

                <div class="contentarea">
                <div class="leftside"><img alt="" src="http://zom.jtechsolutions.co/wp-content/themes/zone/images/pic_1.jpg" /></div>
                <div class="rightside">
                <h2><?php echo $page->post_title; ?></h2>
                <?php echo substr(strip_tags($page->post_content),0,50); ?>

                <a href="<?php echo get_post_permalink($page->ID); ?>">Read More...</a>





 # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

# END WordPress
share|improve this question
Can you post a link to the problem page? – s_ha_dum Feb 27 '13 at 23:44
@s_ha_dum zom.jtechsolutions.co/services – prakashchhetri Feb 27 '13 at 23:53
Those links look right. Unfortunately your theme is not using body_class so I can't tell what template is loading. – s_ha_dum Feb 28 '13 at 0:16
What's your permalink structure? – jfacemyer Feb 28 '13 at 4:01

According to the codex, get_post_permalink applies to custom post types. I don't think you are using a custom post type, right?

Instead, try get_page_link( $page->ID )

share|improve this answer
I used it, it is not working either. zom.jtechsolutions.co/services this is the link – prakashchhetri Feb 28 '13 at 0:02
Your links are correct. htaccess is correct. There's something else awry. Have you perhaps edited your page.php to be the home page? – vancoder Feb 28 '13 at 0:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.