Word press conditional statement

Discussion in 'WordPress' started by ironmankho, Jan 29, 2011.

  1. #1
    Word press conditional statement


    recently i read about conditional from this blog

    http://vanweerd.com/how-to-add-feat...ss-posts-and-pages-the-easy-way/#insert_image

    please read this "Insert featured images as thumbnails in your post or page content"
    and code is


    function InsertFeaturedImage($content) {
     
    global $post;
     
    $original_content = $content;
     
        if ( current_theme_supports( 'post-thumbnails' ) ) {
     
            if ((is_page()) || (is_single())) {
                $content = the_post_thumbnail('page-single');
                $content .= $original_content;
                } else {
                $content = the_post_thumbnail('index-categories');
                $content .= $original_content;
            }
     
        }
        return $content;
    }
     
    add_filter( 'the_content', 'InsertFeaturedImage' );
    PHP:
    i studied this code for thumbnail not shown in full post .... is there any conditional code like "only after readmore content shown" in full post
     
    ironmankho, Jan 29, 2011 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This line restricts it to single posts and pages.
    if ((is_page()) || (is_single())) {

    Is that what you mean? Where do you need the thumbnails to show up?
     
    Cash Nebula, Jan 31, 2011 IP