tags:

views:

48

answers:

1

I want my wordpress blog to have a page called music. On that page I will query the DB for posts with the category music and then change around the look and feel of the posts. So I can't just put a link to "/categories/music/" because I want to do custom work on the posts.

Should I put this code in a separate php file and link to it? I think I may lose access to all the nice wordpress API calls if I do that.

I was thinking about using a filter, but I am not sure which one to use. I was thinking something like the following except "the_title" has not been grabbed yet so I cannot check the title.

function show_music(){

    if( is_page() && the_title('','',false) == 'music' ){
     echo "got here";
    }
}
add_filter('pre_get_posts', 'show_portfolio');

How would you go about this?

+2  A: 

You need to put the below code in the file, and then put the file in the Theme folder. Then you can create a page using Wordpress pages and select a page template with the name you put in this comment:

/*
Template Name: Something Goes Here
*/
Chacha102
sweet...just out of curiosity. i may want to implement this as a plugin. then would i have to use a filter? if so, do you know which?
Tony
I'm not quite sure. I haven't seen many plugins that create there own pages outside of the WP-admin area, so not really sure.
Chacha102