• Resolved auralstates

    (@auralstates)


    pretty simple really. i want to have the option to display the posts in one of my categories 2 different ways: chronologically and alphabetically by title.

    i have used my category-specific .php template for chronological display, and i tried to create another .php in the themes folder and linked to it, basically using the same code as the chrono template (modifying the loop with a query_posts call). the new .php keeps giving me errors though when i try to click it. help?

Viewing 7 replies - 1 through 7 (of 7 total)
  • and i tried to create another .php in the themes folder and linked to it,

    Just to clarify: You linked directly to the php file?

    the new .php keeps giving me errors though when i try to click it

    What kind of errors does it show?

    Thread Starter auralstates

    (@auralstates)

    Just to clarify: You linked directly to the php file?

    yes. i have a feeling the page isn’t being parsed right, since the error occurs at line 1 [call to get_header()]

    What kind of errors does it show?

    Fatal error: Call to undefined function: get_header() in /home/content/a/u/r/auralstates/html/wp-content/themes/auralstates2009/interviews-a-z.php on line 1

    When you create that page, you have to include/require the wp-blog-header.php file located at the base directory.

    e.g.

    include ('yourpathto/wp-blog-header.php');

    As that isn’t a standard file, you’ll have to include the above code to ensure that the WordPress specific codes are interpreted correctly.

    Thread Starter auralstates

    (@auralstates)

    i included it, but doesn’t seem to be working. getting these errors:

    Warning: main(http://www.auralstates.com/wp-blog-header.php): failed to open stream: HTTP request failed! HTTP/1.1 404 in /home/content/a/u/r/auralstates/html/wp-content/themes/auralstates2009/interview-a-z.php on line 1

    Warning: main(http://www.auralstates.com/wp-blog-header.php): failed to open stream: HTTP request failed! HTTP/1.1 404 in /home/content/a/u/r/auralstates/html/wp-content/themes/auralstates2009/interview-a-z.php on line 1

    Warning: main(): Failed opening ‘http://www.auralstates.com/wp-blog-header.php’ for inclusion (include_path=’.:/usr/local/lib/php’) in /home/content/a/u/r/auralstates/html/wp-content/themes/auralstates2009/interview-a-z.php on line 1

    Fatal error: Call to undefined function: get_header() in /home/content/a/u/r/auralstates/html/wp-content/themes/auralstates2009/interview-a-z.php on line 2

    Did you try using relative paths instead of the a full URL?

    You don’t have to make a new file. In your category.php add this above <?php if (have_posts()) : ?>

    <?php if($_GET['sort'] == 'title') query_posts('orderby=title&order=ASC'); ?>

    You can then add a ?sort=title to the URL of the page to sort by title. If the sort is not ‘title’ or empty, it’s sorted by date.

    Thread Starter auralstates

    (@auralstates)

    thanks, that worked perfectly after i added the category ID to the query!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘display category’s posts in 2 different orders’ is closed to new replies.