Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter wellhall12

    (@wellhall12)

    Like i said the thumbnail does shoe up when on the homepage and when i click on a catergory within the menu bar however just doesnt show when searching.

    my content.php where the featured image code is looks like this

    <div class=”entry-content”>
    <?php the_post_thumbnail(‘thumbnail-feature’);?>
    <?php the_content( __( ‘Read more <span class=”meta-nav”></span>’, ‘twentyeleven’ ) ); ?>
    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”><span>’ . __( ‘Pages:’, ‘twentyeleven’ ) . ‘</span>’, ‘after’ => ‘</div>’ ) ); ?>
    </div><!– .entry-content –>
    <?php endif; ?>

    I think i have found the code preventing it showing, what do you think? SHOWN BELOW;

    <footer class=”entry-meta”>
    <?php $show_sep = false; ?>
    <?php if ( ‘post’ == get_post_type() ) : // Hide category and tag text for pages on Search ?>

    <?php
    /* translators: used between list items, there is a space after the comma */
    $categories_list = get_the_category_list( __( ‘, ‘, ‘twentyeleven’ ) );
    if ( $categories_list ):
    ?>

    Thread Starter wellhall12

    (@wellhall12)

    yeah im using twentyeleven theme so i have search.php and searchform.php.

    its really baffling me, the thumbnail show in the home page and when there in there category just wont show when searching

    Thread Starter wellhall12

    (@wellhall12)

    Thanks for your help

    The following code worked

    function wpi_image_content_filter($content){
    
        if (is_home() || is_front_page() || is_category()){
          $content = preg_replace("/<img[^>]+\>/i", "", $content);
        }
    
        return $content;
    }
    add_filter('the_content','wpi_image_content_filter',11);

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.>]

    Thread Starter wellhall12

    (@wellhall12)

    okay so what would the following code look like? sorry im not very good with this.

    something like

    function wpi_image_content_filter($content){
    if (is_category() {
    $content = preg_replace("/<img[^>]+\>/i", "", $content);
    }
    return $content;
    }
    add_filter('the_content','wpi_image_content_filter',11);

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.>]

Viewing 4 replies - 1 through 4 (of 4 total)