ThemeShaper Forums » Thematic

[closed]

Using post thumbs like my homepage, how do I make categories appear like it?>

(2 posts)
  • Started 8 years ago by mrmikeman
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. mrmikeman
    Member

    Im testing things on
    http://ocixx.com/imretarded/

    And Ill be using categories to display the content relavent only to that category, I intend on having only one category be displayed on the home page, content of another category Ill have a link to, which I am hoping to get to display just like the home page, as of now though, it displays its text and a tiny post thumb, which im not even sure how i got it there . :(

    could someone help me make my category pages display just like the home page?
    This is my functions.php now

    <?php
    
    function childtheme_content($content) {
    	if ( is_home () ) {
    		$content= 'image';
    	}
    	return $content;
    }
    add_filter('thematic_content', 'childtheme_content');
    
    function childtheme_image_post($post){
    global $thematic_content_length;
    
    	if ( strtolower($thematic_content_length) == 'image' ) {
    	$post = '';
    		if ( has_post_thumbnail() ) {
    		$post .= '' . get_the_post_thumbnail(get_the_ID(), 'medium') . '';
    		}
    	}
    return $post;
    }
    add_filter('thematic_post', 'childtheme_image_post');
    
    function childtheme_override_postheader_postmeta(){
    
    //the sound of one hand clapping
    }
    
    function childtheme_override_index_loop(){
    		global $options, $blog_id;
    
    		foreach ($options as $value) {
    		    if (get_option( $value['id'] ) === FALSE) {
    		        $$value['id'] = $value['std'];
    		    } else {
    		    	if (THEMATIC_MB)
    		    	{
    		        	$$value['id'] = get_option($blog_id,  $value['id'] );
    		    	}
    		    	else
    		    	{
    		        	$$value['id'] = get_option( $value['id'] );
    		    	}
    		    }
    		}
    
    		/* Count the number of posts so we can insert a widgetized area */ $count = 1;
    		while ( have_posts() ) : the_post();
    				$counter++; 
    
    				thematic_abovepost(); ?>
    
    				<div class="column <?php if ($counter == 1) { echo 'one'; } else { echo 'two'; $counter = 0; } ?>">
    
    				<div class="clear-fix">
    
    				<div id="post-<?php the_ID();
    					echo '" ';
    					if (!(THEMATIC_COMPATIBLE_POST_CLASS)) {
    						post_class();
    						echo '>';
    					} else {
    						echo 'class="';
    						thematic_post_class();
    						echo '">';
    					}
         				thematic_postheader(); ?>
    					<div class="entry-content">
    <?php thematic_content(); ?>
    
    					<?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'thematic') . '&after=</div>') ?>
    					</div><!-- .entry-content -->
    					<?php thematic_postfooter(); ?>
    				</div><!-- #post -->
    				</div><!-- .clear-fix -->
    				</div><!-- .column -->
    
    			<?php 
    
    				thematic_belowpost();
    
    				comments_template();
    
    				if ($count==$thm_insert_position) {
    						get_sidebar('index-insert');
    				}
    				$count = $count + 1;
    		endwhile;
    }
    
    // filter thematic_sidebar() .. no display for the page 'Forum', keep it for the rest
    function remove_sidebar() {
    // We test if we are on the page 'Forum'
    if (is_home()) {
    // Yes, we are .. now we switch off the sidebar
    return FALSE;
    } else {
    // we are not .. we leave the switch on
    return TRUE;
    }
    }
    // Connect the filter to thematic_sidebar()
    add_filter('thematic_sidebar', 'remove_sidebar');
    
    //different style sheet for the homepage
    // filter thematic_create_stylesheet to implement your own stylesheets
    function my_stylesheet($content) {
    // We test if we're on home or on your frontpage
    if (is_home() || is_front_page()) {
    // yes, we are .. now let's load the 3c-fixed layout
    $content = "\t";
    $content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
    $content .= get_bloginfo('stylesheet_directory') . "/style-home.css";
    $content .= "\" />";
    $content .= "\n\n";
    } else {
    // we are not .. let's load the 2c-r-fixed layout
    $content = "\t";
    $content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
    $content .= get_bloginfo('stylesheet_directory') . "/style.css";
    $content .= "\" />";
    $content .= "\n\n";
    }
    // $content will be handed back to thematic_create_stylesheet
    return $content;
    }
    // connect the filter to thematic_create_stylesheet
    add_filter ('thematic_create_stylesheet', 'my_stylesheet');
    //end different style sheet for the homepage
    
    //wrap thumbs in link to post
    
    function my_post_image_html( $html, $post_id, $post_image_id ) {
    
                  $html = '<div class="thumbnail"><a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html .  '<span class="linktopost">' . get_the_title($post_id) . '</span></a></div>';
    
                  return $html;
    
    }
    
    add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
    // The Post Title
        $posttitle = apply_filters('thematic_posttitle',$posttitle);
    
    // Add a custom post footer
    function childtheme_postfooter() {
        global $post;
    
        if (is_single()) { ?>
            <div class="entry-utility">
    
        <?php edit_post_link(__('Edit', 'thematic'), "\n\t\t\t\t\t<span class=\"edit-link\">", "</span>"); ?>
    
            </div><!-- .entry-utility -->
        <?php } else { ?>
            <?php if ( $post->post_type == 'post' ) { // Hide entry utility on searches ?>
                <div class="entry-utility">
    
                    <?php edit_post_link(__('Edit', 'thematic'), "\t\t\t\t\t<span class=\"meta-sep\">|</span>\n<span class=\"edit-link\">", "</span>\t\t\t\t\t"); ?>
                </div><!-- .entry-utility -->
            <?php } ?>
        <?php }
    }
    add_filter ('thematic_postfooter', 'childtheme_postfooter');
    ?>
    Posted 8 years ago #
  2. take a look at the thematic_content() function in content-extensions.php. you;ll see that it decides what type of content to show and where. i already showed you how to change the content type for is_home and we already created the 'image' type. so all you need to do is:

    function childtheme_content($content) {
    	if ( is_home () || is_category() ) {
    		$content= 'image';
    	}
    	return $content;
    }
    add_filter('thematic_content', 'childtheme_content');
    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.