treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Loading Posts into custom page

  • Hi, i have created a page and i want to load all the post with in a specific catagory, anyone know how?
    Many Thanks
    Chris
  • :?: Can you be a bit more specific. Are you talking about Wordpress?
  • Yeah, sorry, i am using the newest version of wordpress. Basicaly i want to create the page that shows all the posts from one catagory, i am aware that you can type in 'mysite.com/catagory/hobbies', but as far as i am aware, that url uses the 'archive.php' file. Which is also used for the archives (obviosly), the problem with this is that i want the archives and this new page to be styled differantly. So i created a new page and gave it a template, and now im trying to work out how to loads the posts into the new page.

    Wooo..... sorry and thanks!
  • Just checking before I gave you my 2 cents worth. :D

    It's best to keep posts and pages separate. You are on the right lines creating a link to that specific category, if you want it to display differently from all the other categories then you can make a custom category template.
    http://codex.wordpress.org/Category_Templates

    Hope that helps.
  • Great, that realy helped. One other thing though.I'm pritty sure it was either a article of tutorial on this site, but it was about using a php code to chane the 'body' id on the page so that current tabscan be selected. This is the code i have.

    $page = $_SERVER['REQUEST_URI'];
    $page = str_replace(\"/\" , \"\", $page);
    $page = str_replace(\".php\" , \"\", $page);
    $page = str_replace(\"?s=\" , \"\", $page);
    $page = $page ? $page : 'default'

    Can someone please explain it to me because i have know idea how to edit it to work with my pages, my url is mysite.com/categories/videos.
    Many Thanks
    Chris
  • Also, is there a way to filter the results in 'the loop' so it only shows results from a certain category.

    Many THanks
    Chris
  • There's a nice little tutorial on changing the body id here http://elliotjaystocks.com/blog/2008/wordpress-tutorialhow-to-apply-a-dynamic-body-class-or-id/

    Not sure what you are asking with your second question. Where are you trying to show your results from a certain category?
  • Thanks, ill look into thatlink, as for the other question, dont worry, i have solved it with a if in category function.
  • im pretty sure simplepie plugin should do what you want, it lets you post everything from a specific category into a static page