← WordPress

Como Remover Imagem Destacada Apenas dentro do Post

Lida 8666 vezes

Offline

Web Reis 
Membro
Mensagens 14 Gostos 0
Troféus totais: 12
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 2 Level 1 10 Posts First Post Signature Webmaster Avatar



    Preciso de Ajuda para usar imagem destacada mais não gostaria que aparecesse dentro do post, tem algum plugin ou configuração que possa fazer para deixar a imagem destacada para somente plugins como Posts "Relacionados" chamem essas imagens destacadas. mais quando entra dentro do post não aparecer?

    bom esse é o código que tem dentro no meu single.php

Código: [Seleccione]
    <?php get_header(); ?>
    <!-- Start dynamic -->
    <main id="main" role="main">
    <section>
    <?php if(have_posts()): while (have_posts()):the_post(); ?>
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <?php edit_post_link('Edit'''''); ?>
    <h2><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h2>
    <p class="img">
    <?php
    
if ( has_post_thumbnail() ) {
    
the_post_thumbnail'custom-size' );
    
}
    
else {
    
if(!has_post_thumbnail()) {
    
echo "<div class=\"img-def-single\"> </div>"; }
    
}

    
?>

    </p>
    <div class="content"><?php the_content();?></div>
    <div class="meta-box-vision">
    <table>
    <tr><th><strong>Contacts:</strong></th></tr>
    <?php get_template_part'content''single' ); ?>
    </table>
    </div>
    <small>Posted by: </small> <em><?php the_author() ?></em> <small>on</small>
    <em class="entry-date"> <?php echo get_the_date(); ?></em>
    <div class="tag-s"> <?php the_tags'Tags: ',' '  ); ?> </div>
    <div class="postpagination">
      <span class="prevpost"><?php previous_post_link('%link'__(' <span class="meta-nav">&larr;</span>previous''classified-ads')); ?></span>
    <span class="nextpost"><?php next_post_link('%link'__('next <span class="meta-nav">&rarr;</span>''classified-ads')); ?></span>
    </div>
       </article>
    <div class="commen"><?php if (comments_open() || get_comments_number()) { comments_template(); } ?></div>
    <?php endwhile; endif; ?>
    <!-- End dynamic -->
    </section>
    <?php get_sidebar(); ?>
    </main>
    <!-- End dynamic -->
    <?php get_footer(); ?>

    Desde-já agradeço!
Offline

Diogo Pinto 
Administrador
Mensagens 4400 Gostos 371
Feedback +4

Troféus totais: 37
Trófeus: (Ver todos)
Avatar Search Level 6 Linux User Mobile User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

Remove este código do teu single.php:

Código: [Seleccione]
    <p class="img">
    <?php
    
if ( has_post_thumbnail() ) {
    
the_post_thumbnail'custom-size' );
    
}
    
else {
    
if(!has_post_thumbnail()) {
    
echo "<div class=\"img-def-single\"> </div>"; }
    
}

    
?>

    </p>
Offline

Web Reis 
Membro
Mensagens 14 Gostos 0
Troféus totais: 12
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 2 Level 1 10 Posts First Post Signature Webmaster Avatar

Remove este código do teu single.php:

Código: [Seleccione]
    <p class="img">
    <?php
    
if ( has_post_thumbnail() ) {
    
the_post_thumbnail'custom-size' );
    
}
    
else {
    
if(!has_post_thumbnail()) {
    
echo "<div class=\"img-def-single\"> </div>"; }
    
}

    
?>

    </p>
- Obrigado Diogo, funcionou.