Hallo Community,
Habe ein Problem mit meiner index Seite von meiner Wordpress Site, die ich gerade erstelle, und zwar geht es darum, das ich in meinem Content bereich nach den Posts, eine NextGen Gallery eingefügt habe, jedoch wenn ich diese anklicke werde ich auf den letzten Post verlinkt
(gerade im aufbau aber man erkennt das problem): http://wp.badenerzeitung.at
meine index.php site
<?php global $theme; get_header();?>
<div id="main">
<?php $theme->hook('main_before'); ?>
<div id="content">
<?php include('grid.php');
if(have_posts()){
/**KAT1*/
$display_categories = array(1); $i = 1;
foreach ($display_categories as $category)
{ ?>
<div id="posts">
<h3><a href="<?php echo get_category_link($category);?>'" ><?php echo get_cat_name($category);?></a></h3>
<?php
$MyCat_Content = get_posts('numberposts=5&category='.$category);
$MyCat_Echo = '';
foreach ($MyCat_Content as $post)
{
$My_Content = strip_tags($post->post_content);
$words = explode(' ', $My_Content, 21);
if (count($words) > 20)
{
array_pop($words);
array_push($words, ' ...');
$My_Content = implode(' ', $words);
}
?>
<p><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></p>
<?php
} ?>
</div>
<?php
}
/**KAT2*/
$display_categories = array(7); $i = 1;
foreach ($display_categories as $category)
{ ?>
<div id="posts">
<h3><a href="<?php echo get_category_link($category);?>'" ><?php echo get_cat_name($category);?></a></h3>
<?php
$MyCat_Content = get_posts('numberposts=4&category='.$category);
$MyCat_Echo = '';
foreach ($MyCat_Content as $post)
{
$My_Content = strip_tags($post->post_content);
$words = explode(' ', $My_Content, 21);
if (count($words) > 20)
{
array_pop($words);
array_push($words, ' ...');
$My_Content = implode(' ', $words);
}
?>
<p><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></p>
<?php
} ?>
</div>
<?php
}
/**KAT3*/
$display_categories = array(6); $i = 1;
foreach ($display_categories as $category)
{ ?>
<div id="posts">
<h3><a href="<?php echo get_category_link($category);?>'" ><?php echo get_cat_name($category);?></a></h3>
<?php
$MyCat_Content = get_posts('numberposts=2&category='.$category);
$MyCat_Echo = '';
foreach ($MyCat_Content as $post)
{
$My_Content = strip_tags($post->post_content);
$words = explode(' ', $My_Content, 21);
if (count($words) > 20)
{
array_pop($words);
array_push($words, ' ...');
$My_Content = implode(' ', $words);
}
?>
<p><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></p>
<?php
} ?>
</div>
<?php
}
/**KAT5*/
$display_categories = array(9); $i = 1;
foreach ($display_categories as $category)
{ ?>
<div id="posts">
<h3><a href="<?php echo get_category_link($category);?>'" ><?php echo get_cat_name($category);?></a></h3>
<?php
$MyCat_Content = get_posts('numberposts=4&category='.$category);
$MyCat_Echo = '';
foreach ($MyCat_Content as $post)
{
$My_Content = strip_tags($post->post_content);
$words = explode(' ', $My_Content, 21);
if (count($words) > 20)
{
array_pop($words);
array_push($words, ' ...');
$My_Content = implode(' ', $words);
}
?>
<p><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></p>
<?php
} ?>
</div>
<?php
}
/**KAT4*/
$display_categories = array(11); $i = 1;
foreach ($display_categories as $category)
{ ?>
<div id="posts">
<h3><a href="<?php echo get_category_link($category);?>'" ><?php echo get_cat_name($category);?></a></h3>
<?php
$MyCat_Content = get_posts('numberposts=2&category='.$category);
$MyCat_Echo = '';
foreach ($MyCat_Content as $post)
{
$My_Content = strip_tags($post->post_content);
$words = explode(' ', $My_Content, 21);
if (count($words) > 20)
{
array_pop($words);
array_push($words, ' ...');
$My_Content = implode(' ', $words);
}
?>
<p><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></p>
<?php
} ?>
</div>
<?php
}
echo '<a href="?page_id=643">wirstduzueinemlink</a>';
}
else {
echo 'no posts';
}
include('albumstart.php');
$theme->hook('content_after'); ?>
</div><!-- #content -->
<?php get_sidebars(); ?>
<?php $theme->hook('main_after'); ?>
</div><!-- #main -->
<?php get_footer(); ?>
Alles anzeigen
Zur erklärung, die KAT`s sind die kategorien die ich angezeigt haben möchte, wenn sich eine fragt warum ich dann nicht eine schleife mache... ich möchte bei jeder Kat verschieden viele Posts anzeigen lassen.
include('grid.php'); sind bilder Oben, die gehen einwandfrei....
Aber wenn ich nun auf die Gallery klicke leitert er mich weiter auf einen post mit folgender URL: http://wp.badenerzeitung.at/?p=331&album=5…ry=1&pageid=331
die gallery kommt aus include('albumstart.php'); und in der steht:
<div id="albumstart"><br/>
<?php
if (function_exists("nggShowAlbum"))
{ echo nggShowAlbum(5); }?>
</div>
es ist egal wo ich die Gallery hinsetze, zb zwischen 2 KATS nimmt er immer den letzten Post der Kat davor.
weiß jemand wo das problem sein könnte?