Hallo,
ich möchte gerne bei bestimmten Posts, ein Teil aus der sidebar verschwinden lassen (siehe php code unten).
Hatte da an eine php code wie z.b.:
if post id ist gleich xy, dann lass es weg,
if not zeig es
gedacht.
Leider hab ich nicht so die php kenntnisse und weiß nicht, wie ich die post id abfragen kann.
Kann mir einer helfen?
Würd mich freuen
PHP
<?php
// this is where 10 headlines from the current category get printed
if ( is_single() ) :
global $post;
$categories = get_the_category();
foreach ($categories as $category) :
?>
<li><h2>Mehr aus dieser Kategorie</h2>
<ul class="bullets">
<?php
$posts = get_posts('numberposts=15&category='. $category->term_id);
foreach($posts as $post) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</li>
<?php endforeach; endif ; ?>
<!--
<?php if ( is_home() ) { ?>
<li><h3><?php
// this is where the name of the News (or whatever) category gets printed
wp_list_categories('include=8&title_li=&style=none'); ?></h3>
<?php
// this is where the last three headlines are pulled from the News (or whatever) category
query_posts('showposts=3&cat=8');
?>
<ul class="bullets">
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
</li>
<?php } ?>
-->
Alles anzeigen