Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-06-23
28
Medium Priority
?
341 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
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…
Suggested Courses

610 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