Zurück   WordPress Deutschland Forum > Support > Design

Antwort
 
Themen-Optionen Ansicht
Alt 19.11.2006, 11:38   #1 (permalink)
PostRank: 4
 
Registriert seit: 24.07.2005
Beiträge: 183
Eine Kategorie auf der Startseite ausblenden

Hallo,

ich suche eine Modifikation, mit der ich eine Kategorie (ID=7) auf der Startseite ausblenden kann. Mein template sieht derzeit so aus:

Code:
<div id="content">

<?php if (have_posts()) : ?>
		
	<?php while (have_posts()) : the_post(); ?>
			
		<div class="post" id="post-<?php the_ID(); ?>">

   <p class="info"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/document.gif" alt="" /> <?php the_time('j. F Y, H:i \U\h\r') ?>, Autor: <?php the_author_posts_link(); ?>, in: <?php the_category(', ') ?></p><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
   <div class="entry">
	 <?php the_content('[weiter]'); ?>
   </div>
   <p class="info"><?php edit_post_link('Edit','','<strong>|</strong>'); ?>  <img src="<?php bloginfo('stylesheet_directory'); ?>/images/comments.gif" alt="" /> <?php comments_popup_link('kommentieren &raquo;', '1 Kommentar &raquo;', '% Kommentare &raquo;'); ?></p>
</div>

	<?php comments_template(); ?>
	<?php endwhile; ?>

		<p align="center"><?php next_posts_link('&laquo; Previous Entries') ?>   <?php previous_posts_link('Next Entries &raquo;') ?></p>

	<?php else : ?>
		<h3 align="center">Not Found</h3>
		<p align="center">Sorry, but you are looking for something that isn't here.</p>
	<?php endif; ?>
		</div>

<!-- end content-->
Kann mir da jemand eine IF-Anweisung o.ä. einbauen, damit Kategorie "7" dort nicht mit angezzeigt wird?

Ich hab mit der Suche "Kategorie ausblenden" leider keine passende Antwort auf mein Problem finden können.
F.LM ist offline   Mit Zitat antworten
Alt 19.11.2006, 12:14   #2 (permalink)
WPD-Team
 
Benutzerbild von jottlieb
 
Registriert seit: 20.08.2005
Ort: Berlin
Beiträge: 15.543
Ungetestet:
PHP-Code:
<div id="content">

<?php if (have_posts()) : ?>
        
    <?php while (have_posts()) : the_post(); ?>
        <?php if (! in_category('7')) { ?>
        <div class="post" id="post-<?php the_ID(); ?>">

   <p class="info"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/document.gif" alt="" /> <?php the_time('j. F Y, H:i \U\h\r'?>, Autor: <?php the_author_posts_link(); ?>, in: <?php the_category(', '?></p><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
   <div class="entry">
     <?php the_content('[weiter]'); ?>
   </div>
   <p class="info"><?php edit_post_link('Edit','','<strong>|</strong>'); ?>  <img src="<?php bloginfo('stylesheet_directory'); ?>/images/comments.gif" alt="" /> <?php comments_popup_link('kommentieren &raquo;''1 Kommentar &raquo;''% Kommentare &raquo;'); ?></p>
</div>
<?php ?>

    <?php comments_template(); ?>
    <?php endwhile; ?>

        <p align="center"><?php next_posts_link('&laquo; Previous Entries'?>   <?php previous_posts_link('Next Entries &raquo;'?></p>

    <?php else : ?>
        <h3 align="center">Not Found</h3>
        <p align="center">Sorry, but you are looking for something that isn't here.</p>
    <?php endif; ?>
        </div>

<!-- end content-->
__________________
"Eine gut gestellte Frage ist schon halb beantwortet." | Fehler in WP 3.0 Sprachdatei gefunden?
jottlieb ist offline   Mit Zitat antworten
Alt 19.11.2006, 12:15   #3 (permalink)
PostRank: 4
 
Registriert seit: 24.07.2005
Beiträge: 183
Funktioniert prima. Verbindlichsten Dank!
__________________
Meine WP-Blogs: SimulationsRaum | F.LM - Texte zum Film
F.LM ist offline   Mit Zitat antworten
Alt 09.12.2007, 12:39   #4 (permalink)
PostRank: 1
 
Registriert seit: 28.11.2007
Beiträge: 34
Habe genau das selbe Anliegen, ich will bestimmte Kategorien auf der Startseite ausblenden, mein index.php Code:

PHP-Code:
<?php get_header(); ?>

    <div id="content">

    <?php if (have_posts()) : ?>

        <?php while (have_posts()) : the_post(); ?>
            <div class="entry">
            <div id="post-<?php the_ID(); ?>">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2><?php if(function_exists('the_ratings')) { the_ratings(); } ?>
                <p class="postmetadata"><?php the_time('F jS, Y'?> by <?php the_author() ?> | Posted in <?php the_category(', '?> | <?php edit_post_link('Edit'''' | '); ?>  <?php comments_popup_link('No Comments »''1 Comment »''% Comments »'); ?></p>


                <?php the_content('Weiter lesen &raquo;'); ?>
                

                
            </div></div>

        <?php endwhile; ?>

        <div class="navigation">
            <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries'?></div>
            <div class="alignright"><?php previous_posts_link('Next Entries &raquo;'?></div>
        </div>

    <?php else : ?>
            <div class="entry">
        <h2>Not Found</h2>
        <p>Sorry, but you are looking for something that isn't here.</p>
        </div>
    <?php endif; ?>

    </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
Dann habe ich sie so geändert, doch dann kommt ein Fehler und es erscheint nur die Fehlermeldung:
PHP-Code:
<?php get_header(); ?>

    <div id="content">

    <?php if (have_posts()) : ?>

        <?php while (have_posts()) : the_post(); ?>
        <?php if (! in_category('11')) { ?> 
            <div class="entry">
            <div id="post-<?php the_ID(); ?>">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2><?php if(function_exists('the_ratings')) { the_ratings(); } ?>
                <p class="postmetadata"><?php the_time('F jS, Y'?> by <?php the_author() ?> | Posted in <?php the_category(', '?> | <?php edit_post_link('Edit'''' | '); ?>  <?php comments_popup_link('No Comments »''1 Comment »''% Comments »'); ?></p>


                <?php the_content('Weiter lesen &raquo;'); ?>
                

                
            </div></div>

        <?php endwhile; ?>

        <div class="navigation">
            <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries'?></div>
            <div class="alignright"><?php previous_posts_link('Next Entries &raquo;'?></div>
        </div>

    <?php else : ?>
            <div class="entry">
        <h2>Not Found</h2>
        <p>Sorry, but you are looking for something that isn't here.</p>
        </div>
    <?php endif; ?>

    </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
Wäre für Hilfe dankbar!

PS: Ich will mehrere Kategorien verstecken...
sandwich01 ist offline   Mit Zitat antworten
Alt 09.12.2007, 12:42   #5 (permalink)
WPD-Team
 
Benutzerbild von jottlieb
 
Registriert seit: 20.08.2005
Ort: Berlin
Beiträge: 15.543
Wenn mir dir helfen soll wäre natürlich die Fehlermeldung interessant
Aber vermutlich fehlt
PHP-Code:
<?php ?>
vor dem endwhile.
__________________
"Eine gut gestellte Frage ist schon halb beantwortet." | Fehler in WP 3.0 Sprachdatei gefunden?
jottlieb ist offline   Mit Zitat antworten
Alt 09.12.2007, 12:49   #6 (permalink)
PostRank: 1
 
Registriert seit: 28.11.2007
Beiträge: 34
Danke, klappt!

Fehlermeldung, wenn ich mehrere Kategorien verstecken will:
Parse error: syntax error, unexpected T_ENDWHILE in public_html/wordpress/wp-content/themes/red-top/index.php on line 28
sandwich01 ist offline   Mit Zitat antworten
Alt 09.12.2007, 16:21   #7 (permalink)
PostRank: 1
 
Registriert seit: 28.11.2007
Beiträge: 34
Hat niemand nen Rat, wie ich mehrere Kategorien auf der startseite verstecken kann?
sandwich01 ist offline   Mit Zitat antworten
Alt 10.12.2007, 02:04   #8 (permalink)
Doc
PostRank: 4
 
Benutzerbild von Doc
 
Registriert seit: 27.06.2007
Ort: Berlin
Beiträge: 251
Code:
<?php get_header(); ?> <div id="content"> <?php query_posts($query_string . 'paged&posts_per_page=5&cat=-46,-47,-49,-50,-140'); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="entry"> <div id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2><?php if(function_exists('the_ratings')) { the_ratings(); } ?> <p class="postmetadata"><?php the_time('F jS, Y') ?> by <?php the_author() ?> | Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> <?php the_content('Weiter lesen &raquo;'); ?> </div></div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div> </div> <?php else : ?> <div class="entry"> <h2>Not Found</h2> <p>Sorry, but you are looking for something that isn't here.</p> </div> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
posts_per_page: Wieviele Beiträge anzeigen lassen?

cat: Welche Kats ausblenden? Minus beachten!!!
__________________
://danieljaeger.DE - WordPress-Tipps aus Berlin!
Doc ist offline   Mit Zitat antworten
Alt 25.01.2008, 21:32   #9 (permalink)
PostRank: 0
 
Registriert seit: 06.01.2008
Beiträge: 17
is vielleicht ne blöde frage,
aber wenn ich eine oder mehrere kategorien in der index.php ausblende, dann werden diese doch in den anderen kategorien auch nicht mehr angezeigt.
leme ist offline   Mit Zitat antworten
Alt 25.01.2008, 21:35   #10 (permalink)
PostRank: 6
 
Benutzerbild von funkygog
 
Registriert seit: 02.11.2006
Ort: Hamburg
Beiträge: 517
Zum verstecken von einzelnen Kategorien gibt es ein praktisches Plug-In:
Advanced Category Excluder

damit kann man festlegen wo Kategorien versteckt werden sollen.
(Archive | Home | RSS-Posts | RSS-Comments | Suchergebnisse)
__________________
funkygog blog [Musik-Archiv und Sonstiges]

Geändert von funkygog (25.01.2008 um 21:38 Uhr).
funkygog ist gerade online   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist aus.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus



Alle Zeitangaben in WEZ +1. Es ist jetzt 19:08 Uhr.


Powered by vBulletin® Version 3.8.4 (Deutsch)
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 | Impressum | WordPress Agentur | Ein Inpsyde.com Projekt