WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] custom php file to display posts in descending and ascending order????? (2 posts)

  1. Kevin Kwok
    Member
    Posted 4 years ago #

    my site: ampersandbox.net

    If you go to the site on the right column you will see a "sort all by" section I need 3 functions.

    • newest - will generate page that lists that displays posts from new to old
    • random - will generate page like newest but in a random order.
    • featured - will do same as above but of a list picked by admin ... i have a plugin that allows me to generate a list of links but thats about it. its called by using `
      <?php featuredpostsList(); ?> `

    so basically by default most wordpress themes does exactly what i need for the newest feature but I have switched index.php to do something else...but i still need that default function. So I assumed i could make a custom php file called SORT.php and paste the old default code that was in index.php which is...

    <?php
    global $options;
    foreach ($options as $value) {
        if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; }
        else { $$value['id'] = get_option( $value['id'] ); }
        }
    ?>
    <?php get_header() ?>
    	<div id="container">
    		<div id="content">
    			<?php thematic_navigation_above();?>
    <?php get_sidebar('index-top') ?>
    <?php thematic_above_indexloop() ?>
    <?php thematic_indexloop() ?>
    <?php thematic_below_indexloop() ?>
    <?php get_sidebar('index-bottom') ?>
    			<?php thematic_navigation_below();?>
    		</div><!-- #content -->
    	</div><!-- #container -->

    however i cant link to this page or get it to work.... please help! thank you!

  2. Kevin Kwok
    Member
    Posted 4 years ago #

    any takers?

Topic Closed

This topic has been closed to new replies.

About this Topic