So I found a template to display subpages directly on parent. I took that one and tried to implement my own template for subpages.
I'm a total noob at php so I´m stuck with guessing.
From the beginning: I want to display a specific subpage on a parent page. The subpage has a few specials (1 alternative title and a second field for content) With the code I have now my parent page displays all subpages and it doesn´t display my aternative title and second field field for content.
Can please anyone check my code and help!?
<?php
/*
Template Name: undersida_m_undersida2
*/
?>
<?php get_header(); ?>
<div class="main_left_undersida">
<div class="postframe"><div class="post" style="width:920px; padding-bottom:20px;">
<div class="content2">
<?php get_the_content_2(); ?>
<?php $altrubrik = get_post_meta($post->ID, 'altrubrik', $undersida = true); ?>
<?php
$my_slug = get_permalink();
$args = array(
'numberposts' => -1,
'post_parent' => $post->ID,
'post_type' => 'page',
'post_status' => 'publish',
'orderby' => 'menu_order,title',
'order' => 'ASC'
);
$c = 0;
$my_pagelist = &get_children($args);
if ($my_pagelist) :
foreach($my_pagelist as $my_child) :
$c++;
$my_child_slug = $my_slug.$my_child->post_name.'/';
?>
<div class="tumnagel2" style="float:left;"><?php echo $my_child->post_content; ?></div>
<div class="right"><?php include (TEMPLATEPATH . '/sidebar3.php'); ?>
<h1 style=" float:left; padding-left:28px; width:500px"><?php echo $altrubrik ?></h1>
<?php the_content_2(); ?></div>
<?php endforeach; ?>
<?php endif; ?>
</div></div></div></div>
<?php get_footer(); ?>