Display wordpress posts on different templates (not based via categories)

I am little more than beginner PHP programmer and just recently started to use wordpress. Right now I have big theoretical problem:

How to display in wordpress list of Posts (yes, default posts, not custom post type) with different template (does not have to be completely different new template) defined by current URL?

Read More

I am using WordPress 3.3.2 and trying to customise wonderfull graphene theme. Runing on Linux/apache with mod_rewrite

Example:
I have posts in my page, which are displaying in front-page, and I have also created a menu with post categories. I am using permalinks.
www.mypage.com <- this shows list of all posts
www.mypage.com/category/dslr/ <- this shows list of all posts in selected category
www.mypage.com/2012/06/12/mozem-auto-komentovat/ <- this one shows single post
That is completely OK, easy to understand, no problem.
Example here: http://portal.vip.sk/vyvoj/astro/en where “astro” is root folder for this test instalation.

What I want to do:
Create a button in main menu, which will point to:
www.mypage.com/different-list
And on that link I will see all queried posts from DB, but the design and query will be different. Please note that different-list is not defined anywhere, nowhere even in the taxonomy, so when i try to use that link i get 404 error.
I also want to use different custom fields from DB in this special listing.

The reason for this construction is as follows:
I want to let users publish their posts, categorise them, fill in metadata for these posts etc. BUT I also want to show these user posts in different manner under different URL. In this list, the posts will be grouped by months (or other time interval), by categories and will use one meta (boolean true, false). And of course the layout of the page will be completely different.

Thank you for any advice

Related posts

Leave a Reply

1 comment

  1. To create a page template, create a new blank php file and populate it as follows:

    <?php
    /**
    * Template Name: The name of you page template
    */
    ?>
    <?php get_header(); ?>
    
    Your content, queries, and stuff.
    
    <?php get_footer(); ?>
    

    Then add a new page, select as template “The name of you page template” and voila.

    For custom fields I suggest you to use the “More Fields” wordpress plugin found here: http://wordpress.org/extend/plugins/more-fields/

    Good luck! 🙂