1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to load posts from one category on a page?

Discussion in 'General Troubleshooting' started by Graeme, Jun 16, 2013.

  1. Graeme

    Graeme Member

    I have created a new page called 'articles', something like this:

    $(h)->pageName = articles

    so I can navigate to www.myurl.com/index.php?page=articles

    On this page I want to show everything in the articles category, how can i do this? An alternative would probably be to go straight to the articles category page, but I wondered if it is possible to do from a custom created page?

    The reason is because I want to use a different stylesheet for this page
    Last edited: Jun 16, 2013
  2. blinger187

    blinger187 New Member

    this sounds very useful. i too would like to see this expanded upon
  3. Graeme

    Graeme Member

    I managed to do this in 2 steps, by using jquery and css.

    1. On your new page, you can do a simple jquery ajax call in just one line:

    $('.your_post_div').load("index.php?category=1 .your_post_div")

    so the posts from a category page get loaded into the same div on your new page.

    2. then you can add a separate style sheet to your new page. This will override the styles used in the page you are loading the content from

    /*whatever */

    --this is just a work-around, probs not the best way, but it's simple and works

Share This Page