WordPress

Witaj Gościu ( Zaloguj | Rejestruj )

Każdy temat założony w ewidentnie złym dziale będzie usuwany! Proszę czytać opisy działów i regulamin!

> Uwaga!

Jeśli opisujesz problem ze skórką - podaj link do downloadu - nie każdy ma tą skórkę co Ty ;)

 
Reply to this topicStart new topic
> Alfabetyczne ustawianie wpisów...
moradil
post 30.10.2007 - 15:04
Post #1


aktywność:
*

Grupa: +Bloger
Postów: 19

Nr: 3 180



Jak u stawić na głównej stronie wpisy tak, żeby układały się alfabetycznie a jak żeby były według ID (bądź daty)? I w jakim dokładnie to zrobić pliku?
Go to the top of the page
 
+Quote Post
Kasia79
post 30.10.2007 - 20:29
Post #2


aktywność:
*******

Grupa: Redakcja
Postów: 868

Nr: 2 641



Zmiany dotyczące strony głównej zazwyczaj są dokonywane w pliku index.php. Standardowo posty są wyśwetlane wg daty (od najnowszego do najstarszego), więc tu nic nie musisz zmieniać.
By mieć posortowane wg daty/ID musisz odnaleźć w index.php
KOD
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
i zamienic to na
KOD
<?php
$posts = query_posts($query_string . '&orderby=xx&order=asc');
if (have_posts()) : while (have_posts()) : the_post(); ?>
Zamiast xx wstawiasz ID jeśli chcesz mieć posty posortowane wg ID lub title, by mieć posortowane alfabatycznie.

Kasia


--------------------
Curiosity killed the cat, but satisfaction brought her back.
Go to the top of the page
 
+Quote Post
moradil
post 30.10.2007 - 21:03
Post #3


aktywność:
*

Grupa: +Bloger
Postów: 19

Nr: 3 180



CYTAT(Kasia79 @ 30.10.2007 - 20:29) *
[code][/code] i zamienic to na
Kasia

Ok, super. Ale u mnie w pliku index.php nie ma wogole takiej linijki dontgetit.gif
CODE
<?php get_header();?>
<div id="content">
<div id="content-main">


<?php if ($posts) {
$AsideId = get_settings('mistylook_asideid');
function stupid_hack($str)
{
return preg_replace('|</ul>\s*<ul class="asides">|', '', $str);
}
ob_start('stupid_hack');
foreach($posts as $post)
{
start_wp();
?>
<?php if ( in_category($AsideId) && !is_single() ) : ?>
<ul class="asides">
<li id="p<?php the_name(); ?>">
<?php echo wptexturize($post->post_content); ?>
<br/>
<?php comments_popup_link('(0)', '(1)','(%)')?> | <a href="<?php the_permalink(); ?>" title="<?php echo wptexturize(strip_tags(stripslashes($post->post_title), '')); ?>" rel="bookmark">#</a> <?php edit_post_link('(edytuj)'); ?>
</li>
</ul>
<?php else: // If it's a regular post or a permalink page ?>
<div class="post" id="post-<?php the_ID(); ?>">
<div class="posttitle">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<p class="post-info">Napisał <?php the_author_posts_link() ?><br> Dodano do <?php the_category(', ') ?></p>
</div>


<div class="entry">
<?php the_content('Czytaj dalej »'); ?>
</div>

<p class="postmetadata"> | <?php edit_post_link('Edytuj', '', ' | '); ?> <?php comments_popup_link('Brak komentarzy »', '1 Komentarz »', '% Komentarzy »'); ?> | <a href="#header">Do gòry</a></p>
<?php comments_template(); ?>
</div>
<?php endif; // end if in category ?>
<?php
}
}
else
{ ?>
<h2 class="center">Brak</h2>
<p class="center">Nie ma podanego adresu.</p>
<?php }
?>
<p align="center"><?php posts_nav_link(' - ','« wstecz','dalej »') ?></p>
</div><!-- end id:content-main -->
<?php get_sidebar();?>
<?php get_footer();?>
Go to the top of the page
 
+Quote Post
b4it
post 31.10.2007 - 11:00
Post #4


aktywność:
*****

Grupa: Redakcja
Postów: 287

Nr: 60



Dodaj
KOD
<?php $posts = query_posts($query_string . '&orderby=xx&order=asc'); ?>
Pod:
HTML
<div id="content-main">


--------------------
b4it's log

4Avatars v0.2
Nie jestem darmowym, prywatnym pomocnikiem!
Go to the top of the page
 
+Quote Post
moradil
post 31.10.2007 - 11:23
Post #5


aktywność:
*

Grupa: +Bloger
Postów: 19

Nr: 3 180



Działa smile.gif dzięki wielkie

a da się zrobić, żeby najnowszy wpis wyświetlało a potem alfabetycznie??

z tego co widzę, to kiedy doda się ten kawałek kodu do pliku archive.php ustawia w kategoriach alfabetycznie smile.gif

Ten post edytował moradil 31.10.2007 - 11:26
Go to the top of the page
 
+Quote Post
konkordpl
post 13.2.2008 - 15:06
Post #6


aktywność:
*

Grupa: Bloger
Postów: 1

Nr: 3 739



Pozwolę sobie odświeżyć, otóż mam trochę inny problem.
Nic nie zmieniałem w moim wordpressie, normalnie wpisy były ułożone od najnowszego do najstarszego - zarówno w panelu admina jak i na stronie głównej. Teraz jakimś cudem mam je ustawione od najstarszego do najnowszego... I za cholere nie wiem jak to się stało ani jak to zmienić...
Ma ktoś jakieś propozycje?

Adres bloga: www.baskiewicz.pl

Ten post edytował konkordpl 13.2.2008 - 15:08
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



Wersja Lo-Fi Aktualny czas: 22 11 08 - 13:05
Polski Blogger | Forum Komputerowe | Spotkania blogerów