Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Display a thumbnail, ONLY if the post has a post_thumbnail « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Display a thumbnail, ONLY if the post has a post_thumbnail

(3 posts)
  • Started 5 years ago by Dopang
  • Latest reply from Chris
  • This topic is not resolved

Tags:

  1. Dopang
    Member

    Hi.. First of all, sorry for my bad english.

    I want to display the post_thumbnail on the homepage by floating it to the left, while the title, meta, content, etc are floated to the right. Here's the image for example. And here's my function for the index section:

    function thumb_index_loop(){
           while ( have_posts() ) : the_post()  // Start the loop:
        // This is just what we decide to show in each post ?>
        <div id="post-<?php the_ID() ?>" class="<?php thematic_post_class() ?>">
    <?php if ( has_post_thumbnail()) { ?>
    
    	<div class="pic fl"><!--floating thumbnail to the left-->
    		<a>">
    		<?php the_post_thumbnail(); ?></a>
    	</div>
    
     <?php	} ?>
    <div class="postfloater"><!--floating post elements to the right-->
         <?php thematic_postheader(); ?>
            <div class="entry-content">
    				<?php the_excerpt(); ?>
            </div>
            <?php thematic_postfooter(); ?>
    </div><!--postfloater-->
    <div class="clear"></div>
        </div><!-- .post -->
        <?php
        endwhile; // loop done, go back up
    }
    
    add_action('thematic_indexloop', 'thumb_index_loop');

    The problem is, when the post didn't have a thumbnail, the post elements still floated to the right. So what i want to do is make a conditional function that floated the post elements to the right when the post has a thumbnail, and show the post elements without the floater div when it didn't have a thumbnail.

    I always end up with syntax error, by doing trial and error with the conditional function (php if, else, etc..)

    Any ideas?

    Posted 5 years ago #

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    helgatheviking

    Moderator

    why are you float the post elements to the right? what if you float them to the left?

    Posted 5 years ago #

  3. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    Chris

    Moderator

    Put the whole stuff into that if stucture. Plus Else do the regular stuff without the floats.

    Chris

    Posted 5 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183