ThemeShaper Forums » Thematic

[closed]

got featured images on my cat pages but their all off..pwease help :(

(10 posts)
  • Started 9 years ago by mrmikeman
  • Latest reply from mrmikeman
  • This topic is resolved
  1. mrmikeman
    Member

    Sorry Iv been posting a lot here for help, but I finally got featured images on my category pages like I wanted to, and removed the_content from them I did this by adding a second conditional tag to the code i had making thumbs for the home page, ssens i want the category pages to be like the home page, and it worked, for the most part, all of my feature images are running off to the right..
    http://ocixx.com/imretarded/category/nice-cat/

    im hoping to have them like ocixx.com/imretarded
    any one know?
    here is my functions.php

    <?php
    
    function childtheme_content($content) {
    	if ( is_home()||is_category()  ) {
    		$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 home page 'home'
    if (is_home()||is_category() ) {
    // 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() || is_category()) {
    // 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');
    
    add_theme_support( 'post-thumbnails' );
    
    ?>
    Posted 9 years ago #
  2. please try using http://www.getfirebug.com

    this is a CSS issue mostly

    .entry-content .wp-post-image {
    float: right;
    }

    is causing the images to be over there.

    Posted 9 years ago #
  3. mrmikeman
    Member

    thanks helg, iv been using google chrome to inspect elements, unfortunatly i cant really make 100% sense out of the things i see in there so its hard to figure it out, i have a lot of learning to do and im afraid im not that good at learning it :-/
    thinkg youed mind helping me again, i got them floating left now, but still not lining up in rows of 3 like home page. :(

    Posted 9 years ago #
  4. ahhhh... yeah i use chrome too. it is just easier to say firebug-it.

    of course the category page doesn't look the same. it is running its own loop and you only added the column markup to the index loop. if you want them to line up line the home page then you have to make the category_loop do the same thing as the index_loop

    you could either right a custom childtheme_override_category_loop or you could probably just set it to equal the index loop

    `
    function childtheme_override_category_loop() {
    childtheme_override_index_loop()
    }
    '

    Posted 9 years ago #
  5. mrmikeman
    Member

    I get an
    Parse error: syntax error, unexpected '}'
    so i remove the } to see if that works, it didnt, i added a l which is probably stupid but that didnt work.. i :-/ im hopeless

    Posted 9 years ago #
  6. Parse error: syntax error, unexpected '}'

    parse errors usually mean that you are missing a squiggly bracket or missing a semi-colon

    is this better?

    function childtheme_override_category_loop() {
    childtheme_override_index_loop();
    }
    Posted 9 years ago #
  7. mrmikeman
    Member

    oh my... i found an article saying missing a }, but the first thing you gave me did have the ending } so i was like well thats not it cause there is a } but it didnt tell me about the semi colon, even though i think i tried adding one somewhere but i tend to do a lot of different things at once, which i shouldnt..

    helga, my gratitude and appreciation goes out to you for all your help, i cannot thank you enough for your time effort and most of all your patients with me :)

    Posted 9 years ago #
  8. mrmikeman
    Member

    :-D <3 <3
    so i simply repeated the override loop for archive, search, :-D and they all work!! i cant believe it!! :-D THANK YOU!!

    Posted 9 years ago #
  9. <bows graciously> you're welcome. parse errors almost always mean you are missing a } ; or sometimes a ) though the actual verbiage of the error makes it sound so much more severe.

    i once did something similar to what you are doing... essentially creating a default loop. i might push for that if start getting more into the dev side of thematic.

    don't forget to mark as resolved.

    Posted 9 years ago #
  10. mrmikeman
    Member

    :-D yeah i hope some day simple options like these will be built in, but its still fun learning it too, just wish i wasnt so programming handicapped :-D

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.