ThemeShaper Forums » Thematic

[closed]

Specific layout for category, it's subcategories and posts under it.

(2 posts)
  • Started 12 years ago by quokka
  • Latest reply from quokka
  • This topic is resolved

Tags:

  1. quokka
    Member

    Hi,

    Just started with Thematic and already loving it!

    Can't find a solution in these or other forums..
    Any help would be appreciated!

    I want to use two different layouts, I use a seperate page layout for this.
    -One page layout for my blog
    -One page layout for my portfolio

    In my theme options panel I created a select list that allows selecting the page that acts as holder for the blog, and page that acts as holder for the portfolio.

    So now I know which page name is related to the blog and which to the portfolio.

    Is there a way to see if a displayed category, subcategory or post is under the blog or portfolio page. In other words, can i check if someone is viewing the blog or portfolio and use the related layout?

    Thanks!
    Quokka

    Posted 12 years ago #
  2. quokka
    Member

    Hi,
    Took me lots of testing and reading of other forum posts and WP / Thematic documentation before I finally realized it's fairly simple..I was thinking too complicated once again :)

    For anyone interested here's my code....

    // This sets up the layouts and styles selected from the options panel
    
    if (!function_exists('optionsframework_wp_head')) {
    	function optionsframework_wp_head() {
    	global $data;
    	if((is_single()) OR is_page()){
    	if(!is_front_page()){
    			$layout = $data['postpage_layout'];
    	}
    	}elseif(is_front_page()) {
    			$layout = $data['front_page_layout'];
    	}else{
    			$layout = $data['layout'];
    	}
    	// Kills sidebar if single column layout is selected
    	if ($layout == '1col-fixed.css'){
    			add_action('thematic_sidebar', 'kill_sidebar');
    	}
    	wp_register_style('layout', LAYOUTS . $layout );
        wp_enqueue_style('layout');
    
    	// Alt Styles
    	$alt_style = $data['alt_stylesheet'];
    		if ($alt_style == '') {
    		 	$alt_style = 'default.css';
    		}
    	//echo $alt_style;
    	wp_register_style('alt_style',STYLES . $alt_style);
        wp_enqueue_style('alt_style');
    	}
    }
    add_action('wp_print_styles', 'optionsframework_wp_head');
    
    function kill_sidebar() {
    	return FALSE;
    }
    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.