Solved

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

Posted on 2008-06-23
28
332 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
Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

737 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