Jump to content
Sign in to follow this  
section25

reverse post order

Recommended Posts

section25

I want the posts to read from 1st to last like a book not most recent first. I've achieve this to some degree using a plugin cbnet Different Posts Per Page but my home page displays a previous entries link unless I use a pagination plugin like WP-PageNavi and my table of contents page (which uses another plugin Site Table of Contents) lists the posts most recent to oldest I've read i can insert this line of code <?php query_posts($query_string . "&order=ASC") ?> in the index.php in pagelines platform pro this file seems empty -- can i use this line of code by putting it somewhere else www.250textbooks.co.uk

Share this post


Link to post
Share on other sites
bevj

i use a plugin called post type order by NSP code that is pretty efficient at ordering post as desired, and without code. Cheers, Bev

Share this post


Link to post
Share on other sites
Kate

Thanks for the suggestion, Bev. Alan: let us know if you require additional help.

Share this post


Link to post
Share on other sites
section25

thanks - i have 3000 posts so that plugin doesnt really improve over my existing reorder plugin.

Share this post


Link to post
Share on other sites
cmunns

well if you use the Base child theme then you can use a hook to do this. In your functions.php file of the Base theme add this bit of code ` add_action('pagelines_before_theloop', 'reverseit'); // function name function reverseit(){ global $wp_query; query_posts( array_merge( array( 'order' => 'ASC' ), $wp_query->query ) ); } `

Share this post


Link to post
Share on other sites
section25

unfortunately it generated this error on my home page Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/textbook/public_html/wp-content/themes/platformbase/functions.php on line 71

Share this post


Link to post
Share on other sites
section25

well that message disappeared when i disabled my existing reorder plugin but now my homepage displays the wrong thing

Share this post


Link to post
Share on other sites
section25

i removed the code now my ste has gone - only the message Parse error: syntax error, unexpected $end in /home/textbook/public_html/wp-content/themes/platformbase/functions.php on line 60 i cant even log in to try and fix it --- any ideas please?

Share this post


Link to post
Share on other sites
section25

restored the site bu deleting the base theme from the server then reinstalling it through wordpress -- phew!

Share this post


Link to post
Share on other sites
section25

yeah i started with a google search of course - that's where i found my current solution - because the neatest aproach semed to binvolve modifying some code thats why i asked here for platform specific advice on that! like i say one solution offered on here would mean me drag and dropping 3000 items in a list when and the other nearlly destroyed my site my current solution is the best so far now I've done my best to avoid the abarrent previous entries links from the bottom of the home page and elsewhere. im stuck with a reveres TOC but thats not a deal breaker thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×