Solved

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

Posted on 2008-06-23
28
323 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
hi experts
sorry for late , ok i am still need help please
0
 
LVL 15

Expert Comment

by:dosth
Comment Utility
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
Comment Utility
can you get me this screens?
0
 

Author Comment

by:faresahmad
Comment Utility
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
Comment Utility
please help
0
 

Author Comment

by:faresahmad
Comment Utility
??????????
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 15

Expert Comment

by:dosth
Comment Utility
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
Comment Utility
what i shall do ?
0
 

Author Comment

by:faresahmad
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
can you tell me the page that i can change its code ? what is the changs
0
 
LVL 25

Expert Comment

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

Author Comment

by:faresahmad
Comment Utility
ÿ<?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
Comment Utility
please notes that ther are some word in arabic in this code  .
0
 
LVL 25

Accepted Solution

by:
James Rodgers earned 500 total points
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
This article discusses how to create an extensible mechanism for linked drop downs.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

762 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

7 Experts available now in Live!

Get 1:1 Help Now