Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.