Solved

change the posts in the main page from ASC to  descending order (latest posts first)

Posted on 2008-06-23
28
326 Views
Last Modified: 2013-12-12
hi experts

i use the wordpress , i need to change the orde of the posts descending (latest posts first) in the main page , what i shall do ? is there are any change in the PHP code ? tell me what is the change and in with file .

thank you
0
Comment
Question by:faresahmad
  • 11
  • 10
  • 4
28 Comments
 
LVL 15

Expert Comment

by:dosth
ID: 21846018
it is a setting, change it directly
<URL removed by request via mail>

check the radio option Your latest posts
0
 

Author Comment

by:faresahmad
ID: 21846305
ok  i try this put it is not work ,  i edit the blogs to show the last 6 blogs , but it sill not work

thank you
0
 
LVL 15

Expert Comment

by:dosth
ID: 21846336
please delete this question and create, i was not supposed to show the url, please do this for me
0
 
LVL 15

Expert Comment

by:dosth
ID: 21846743
dear fares

kindly do this for me, i am in lot of trouble right now

Thanks
Dosth Mohammed
0
 
LVL 15

Expert Comment

by:dosth
ID: 21847962
Dear Fares

Can you able to help me with this, i will be thankful to you if you can delete this question working with moderator

Please save my job

thanks
Dosth
0
 
LVL 15

Expert Comment

by:dosth
ID: 21848832
sure, the question if fine, i will surely help on this post

Thanks for every one involved in this and i am very thankful

Thanks and thanks a lot

Love EE and will help on things i know for sure.

Thanks again
0
 

Author Comment

by:faresahmad
ID: 21853015
hi experts
sorry for late , ok i am still need help please
0
 
LVL 15

Expert Comment

by:dosth
ID: 21853137
what version you are using?
also can you do a screen shot this pages?

/wp-admin/options-reading.php
/wp-admin/edit.php

my understanding is by default the post are order by date desc



0
 
LVL 15

Expert Comment

by:dosth
ID: 21864197
can you get me this screens?
0
 

Author Comment

by:faresahmad
ID: 21864683
ok this is screen shoot , please notes this is in arabic language not in English
please help me
wordpress.zip
0
 

Author Comment

by:faresahmad
ID: 21865189
please help
0
 

Author Comment

by:faresahmad
ID: 21865276
??????????
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 15

Expert Comment

by:dosth
ID: 21865531
the only thin i am getting confused is

i dont see this option

http://www.cagintranet.com/archive/howto-wordpress-as-an-easy-cms/

4. Setting the Options

i am seeing this in english version thoug
0
 

Author Comment

by:faresahmad
ID: 21865700
what i shall do ?
0
 

Author Comment

by:faresahmad
ID: 21866036
this is option is exist , if you can notes , the first option is show the last posts (in dropdown option)
0
 
LVL 15

Expert Comment

by:dosth
ID: 21866167
i see your first post is showing as june 23 08, it means it is showing order by the last post date, am i wrong?
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 21866247
ok, by default wp orders pages form news to oldes from top to bottom, have you altered the page code? are you using a static front page, custom from page or default fromt page?

in wp-admin under
settings>reading
there are several options first is
Front page displays:
and options are
  your latest posts
  a static page
which have you selected?

if you selected a static page have you selected a page for displaying your posts? is thsi a wordpress page or a page you created?
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 21866301
since by default wp places p[osts in descending order(newest to oldest) you might have entered some bad code in to a page
did you chane or add to a page the following php code?
query_posts();

maing changes to this command MAY change the way wp processes posts
0
 
LVL 15

Expert Comment

by:dosth
ID: 21867732
category/general/
category/s_var/

i see order by date is fine, can you show me where is the problem?
0
 

Author Comment

by:faresahmad
ID: 21876138
the problem is the the post  in the main page appear ASC not DESC acoording to the dates of posts

 
0
 

Author Comment

by:faresahmad
ID: 21876168
can you tell me the page that i can change its code ? what is the changs
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 21877576
post the page code, unless we can see the actual page code its all just guessing
0
 

Author Comment

by:faresahmad
ID: 21891540
ÿ<?php get_header(); ?>

      <div id="content" class="narrowcolumn">

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

                    <div class="title">
                    
            <div class="datebox"><br /><?php the_time('\<\s\p\a\n\>j\<\/\s\p\a\n\> \<\b\r \/\> M\<\b\r \/\>Y') ?></div>
                        <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
                    </div>
                    <div class="post">
                      <div class="entry">
                        <?php the_content('<!-- Read More -->'); ?>
                          <ul class="buttons">
                           <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">'B1# 'DE2J/ &raquo;</a></li>
                            <li><?php edit_post_link('*-1J1 */HJF)'); ?></li>
                          </ul>
                    </div>
                      <div class="postinfo">
                        <p>(H'37) : <strong><?php the_author() ?></strong><br />
                  <?php comments_popup_link('D' *9DJB'* ', '*9DJB H'-/...', '% *9DJB...'); ?></p>
                          <p>'D#B3'E:</p>
                                <ul class="catlist onecol">
                      <li><?php the_category('</li><li>') ?></li>
                      </ul>
                      </div>
                    </div>
                  </div>
      
            <?php endwhile; ?>
                  <div class="navigation">
                  <div class="alignleft"><?php next_posts_link('&laquo; 'DEH'6J9 'D3'(B)') ?></div>
                  <div class="alignright"><?php previous_posts_link(''DEH'6J9 'DD'-B) &raquo;') ?></div>
            </div>
      <?php else : ?>

            <div class="title">
              <h2>:J1 EH,H/</h2>
            </div>
            <p class="center">'D5A-) 'D*J 7D(*G' :J1 EH,H/).</p>
            <?php include (TEMPLATEPATH . "/searchform.php"); ?>

      <?php endif; ?>
      
      
  </div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

------------------------------------------
this is the code of the main page

thank u  very much
0
 

Author Comment

by:faresahmad
ID: 21891550
please notes that ther are some word in arabic in this code  .
0
 
LVL 25

Accepted Solution

by:
James Rodgers earned 500 total points
ID: 21898548
the code looks fine but try adding this just before the <?php if (have_posts()) : ?> line

<?php query_posts('orderby=date&order=DESC'); ?>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part I (http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_8410-Getting-Started-In-WordPress-Part-I.html), I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now