Hallo,
wie kann ich verhindern das Neue Artikel auf der Startseite erscheinen,
ich möchte das diese nur in der gewählten Kategorie erscheinen?
BG Chris:?:
Startseite
-
Ruhrgebiet -
5. August 2010 um 19:42
-
-
- Gerade eben
- Anzeige
Hallo!
Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.
- ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
- ✔️ Deutsche Server & DSGVO-konform
- ✔️ Persönlicher Support (kein 0815-Ticket-System)
-
Den Loop herausnehmen, wenn gar keine Artikel angezeigt werden sollen??
-
Den Loop herausnehmen, wenn gar keine Artikel angezeigt werden sollen??
Hallo,
danke für den tipp. Es sollen schon artikel angezeigt werden nur möchte ich das halt irgendwie auswählen können.
Und was passiert wenn ich den Loop rausnehme denn Genau ???
bin kein Coder !
BG
Chris -
Schau dir das mal an:
http://codex.wordpress.org/The_Loop -
das hilft mir loop noob auch nicht weiter
-
Poste mal deinen Code aus der index.php
-
Hier ist die komplette Index des themes
PHP
Alles anzeigen<?php get_header(); ?> <div class="art-content-layout"> <div class="art-content-layout-row"> <?php include (TEMPLATEPATH . '/sidebar1.php'); ?><div class="art-layout-cell art-content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="art-post"> <div class="art-post-tl"></div> <div class="art-post-tr"></div> <div class="art-post-bl"></div> <div class="art-post-br"></div> <div class="art-post-tc"></div> <div class="art-post-bc"></div> <div class="art-post-cl"></div> <div class="art-post-cr"></div> <div class="art-post-cc"></div> <div class="art-post-body"> <div class="art-post-inner art-article"> <?php ob_start(); ?> <h2 class="art-postheader"> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>"> <?php the_title(); ?> </a> </h2> <?php $icons = array(); ?> <?php if (!is_page()): ?><?php ob_start(); ?><?php the_time(__('F jS, Y', 'kubrick')) ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page()): ?><?php ob_start(); ?><?php _e('Author', 'kubrick'); ?>: <?php the_author_posts_link() ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?> <div class="art-postheadericons art-metadata-icons"> <?php echo implode(' | ', $icons); ?> </div> <?php endif; ?> <?php $metadataContent = ob_get_clean(); ?> <?php if (trim($metadataContent) != ''): ?> <div class="art-postmetadataheader"> <?php echo $metadataContent; ?> </div> <?php endif; ?> <div class="art-postcontent"> <!-- article-content --> <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?> <?php if (is_page() or is_single()) wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <!-- /article-content --> </div> <div class="cleared"></div> <?php ob_start(); ?> <?php $icons = array(); ?> <?php if (!is_page()): ?><?php ob_start(); ?><?php printf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', ' '); ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?> <div class="art-postfootericons art-metadata-icons"> <?php echo implode(' | ', $icons); ?> </div> <?php endif; ?> <?php $metadataContent = ob_get_clean(); ?> <?php if (trim($metadataContent) != ''): ?> <div class="art-postmetadatafooter"> <?php echo $metadataContent; ?> </div> <?php endif; ?> </div> <div class="cleared"></div> </div> </div> <?php endwhile; ?> <?php $prev_link = get_previous_posts_link(__('Newer Entries »', 'kubrick')); $next_link = get_next_posts_link(__('« Older Entries', 'kubrick')); ?> <?php if ($prev_link || $next_link): ?> <div class="art-post"> <div class="art-post-tl"></div> <div class="art-post-tr"></div> <div class="art-post-bl"></div> <div class="art-post-br"></div> <div class="art-post-tc"></div> <div class="art-post-bc"></div> <div class="art-post-cl"></div> <div class="art-post-cr"></div> <div class="art-post-cc"></div> <div class="art-post-body"> <div class="art-post-inner art-article"> <div class="art-postcontent"> <!-- article-content --> <div class="navigation"> <div class="alignleft"><?php echo $next_link; ?></div> <div class="alignright"><?php echo $prev_link; ?></div> </div> <!-- /article-content --> </div> <div class="cleared"></div> </div> <div class="cleared"></div> </div> </div> <?php endif; ?> <?php else : ?> <h2 class="center"><?php _e('Not Found', 'kubrick'); ?></h2> <p class="center"><?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?></p> <?php if(function_exists('get_search_form')) get_search_form(); ?> <?php endif; ?> </div> <?php include (TEMPLATEPATH . '/sidebar2.php'); ?> </div> </div> <div class="cleared"></div> <?php get_footer(); ?> -
Schau dir den Code mal an:
Hab dir das wichtige Element hervorgehobenPHP
Alles anzeigen<?php get_header(); ?> <div class="art-content-layout"> <div class="art-content-layout-row"> <?php include (TEMPLATEPATH . '/sidebar1.php'); ?><div class="art-layout-cell art-content"> [COLOR=Red][I][B]<!-- Hier startet dein Loop und hier kannst du die Kategorien ausbinden --> <?php query_posts($query_string . '&cat=-3,-8'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <!-- Kommentar Ende -->[/B][/I][/COLOR] <div class="art-post"> <div class="art-post-tl"></div> <div class="art-post-tr"></div> <div class="art-post-bl"></div> <div class="art-post-br"></div> <div class="art-post-tc"></div> <div class="art-post-bc"></div> <div class="art-post-cl"></div> <div class="art-post-cr"></div> <div class="art-post-cc"></div> <div class="art-post-body"> <div class="art-post-inner art-article"> <?php ob_start(); ?> <h2 class="art-postheader"> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>"> <?php the_title(); ?> </a> </h2> <?php $icons = array(); ?> <?php if (!is_page()): ?><?php ob_start(); ?><?php the_time(__('F jS, Y', 'kubrick')) ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page()): ?><?php ob_start(); ?><?php _e('Author', 'kubrick'); ?>: <?php the_author_posts_link() ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?> <div class="art-postheadericons art-metadata-icons"> <?php echo implode(' | ', $icons); ?> </div> <?php endif; ?> <?php $metadataContent = ob_get_clean(); ?> <?php if (trim($metadataContent) != ''): ?> <div class="art-postmetadataheader"> <?php echo $metadataContent; ?> </div> <?php endif; ?> <div class="art-postcontent"> <!-- article-content --> <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?> <?php if (is_page() or is_single()) wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <!-- /article-content --> </div> <div class="cleared"></div> <?php ob_start(); ?> <?php $icons = array(); ?> <?php if (!is_page()): ?><?php ob_start(); ?><?php printf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', ' '); ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?> <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?> <div class="art-postfootericons art-metadata-icons"> <?php echo implode(' | ', $icons); ?> </div> <?php endif; ?> <?php $metadataContent = ob_get_clean(); ?> <?php if (trim($metadataContent) != ''): ?> <div class="art-postmetadatafooter"> <?php echo $metadataContent; ?> </div> <?php endif; ?> </div> <div class="cleared"></div> </div> </div> <?php endwhile; ?> <?php $prev_link = get_previous_posts_link(__('Newer Entries »', 'kubrick')); $next_link = get_next_posts_link(__('« Older Entries', 'kubrick')); ?> <?php if ($prev_link || $next_link): ?> <div class="art-post"> <div class="art-post-tl"></div> <div class="art-post-tr"></div> <div class="art-post-bl"></div> <div class="art-post-br"></div> <div class="art-post-tc"></div> <div class="art-post-bc"></div> <div class="art-post-cl"></div> <div class="art-post-cr"></div> <div class="art-post-cc"></div> <div class="art-post-body"> <div class="art-post-inner art-article"> <div class="art-postcontent"> <!-- article-content --> <div class="navigation"> <div class="alignleft"><?php echo $next_link; ?></div> <div class="alignright"><?php echo $prev_link; ?></div> </div> <!-- /article-content --> </div> <div class="cleared"></div> </div> <div class="cleared"></div> </div> </div> <?php endif; ?> <?php else : ?> <h2 class="center"><?php _e('Not Found', 'kubrick'); ?></h2> <p class="center"><?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?></p> <?php if(function_exists('get_search_form')) get_search_form(); ?> <?php endif; ?> </div> <?php include (TEMPLATEPATH . '/sidebar2.php'); ?> </div> </div> <div class="cleared"></div> <?php get_footer(); ?> -
was muss ich genau machen damit die kategorien rauskommen????
Sorry ich weiß ich nerve ve.
aber danke schon mal bist jetzt echt klasse deine hilfe -
Schau dir den Part mal an "&cat=-3,-8"! Dort gibst du die Kategorie-ID ein, welche ausgeblendet werden soll...
Die Kategorie-ID findest du unter:
"Artikel"->"Kategorien"Einfach mit der Maus mal über die Kategorie-Namen fahren und unten im Browser schauen... da steht dann die ID der jeweiligen Kategorie...
-
sorry den part gibts in der index.php nicht oder
ich will folgende kategorien ausschließen
42, 3, 44, 36 also muss ich jetzt den roten text einfügen und entsprechend ändern ?????? und diese kategorien werden dann auf der startseite nicht mehr berücksichtigt ??? -
RISCHDISCH! ;-)
Kopier einfach den Code von mir und dann noch die Kategorien hinterlegen und dann sollte das Ganze funktionieren....
-
ok kapische
wofür steht die -8 in dem tag
wenn ich das so macheZitat<?php query_posts($query_string . '&cat=-3,42,44,36,-8'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>schließt er aber auch die kategorie id1 mit aus, warum ??
-
wofür steht die -8 in dem tag
... wie du hier schon lesen konntest schließt du mit dem minus davor die Kategorien aus, und ohne minus legst du sie fest.
wenn ich das so mache schließt er aber auch die kategorie id1 mit aus, warum ??
ja, muss er ja, da du sagst, nehme nur die Kategorien 42,44,36 und nicht 3,8! -
also muss das dann so sein
Zitat<?php query_posts($query_string . '&cat=1,-3,-42,-44,-36'); ?>
ich muss vor jede kategorie die ich ausblenden will ein minus setzen und die welche ich anzeigen will auf der startseite ohne minus ? -
ich muss vor jede kategorie die ich ausblenden will ein minus setzen
jeppund die welche ich anzeigen will auf der startseite ohne minus ?
muss nicht unbedingt sein, sollte auch ohne gehen
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!