Jump to content

Code for adding teasers to all pages


sotiro123

Recommended Posts

I'm new to all this so I'm finding it impossible to find an answer to this so hopefully someone can help me.

I found this code on the internet which adds teasers to 1 static page. However, I want to add teasers from posts in a category  to any page I specify.

Any help would be much appreciated.

 

class custom_loop extends thesis_custom_loop {
    function page() {
        if(is_page('thesis-size')) {
              global $thesis_design;
    $thesis_design->home['body']['content']['features'] = 0;
    $thesis_design->display['archives']['style'] = 'teasers';
    $thesis_design->image['thumb']['y'] = 'before-headline';
    $thesis_design->teasers['options']['date']['show'] = 1;
    $thesis_design->teasers['options']['excerpt']['show'] = 1;
    $thesis_design->teasers['options']['edit']['show'] = 0;  
            global $wp_query;
            $saved_query = $wp_query;
            thesis_loop::page();
            wp_reset_query();
            $args = array('category_in' => array(199,186));
            $loop = query_posts("cat=199");
            thesis_loop::home();
            wp_reset_query();
            $wp_query = $saved_query;
        } else 
            thesis_loop::page();
    }
}
$custom_loop = new custom_loop();

Link to comment
https://forums.phpfreaks.com/topic/257534-code-for-adding-teasers-to-all-pages/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.