Suporte » Plugins » Imagens em destaque como http://samclaflin.com.br/

  • Gostaria de saber como faz pra colocar imagens em destaque como esse site http://samclaflin.com.br/ , percebam que as imagens ficam em destaque acima dos post, pois bem, gostaria de saber como se faz. Muito obrigado.
    *obs: sou nova nessa área, então se for pra colocar algo no functions.php explique a baixo de que tag, pf 😀 Muito obrigada.

Visualizando 5 respostas - 1 até 5 (de um total de 5)
  • Olá, vamos tentar ajuda-la. O código que puxa a imagem destacada do post é o <?php the_post_thumbnail(); ?>. Coloque isso acima do seu post, antes do <?php the_title(); > e <?php the_content(); ?>.

    Feito isso, seu post deve ter uma imagem destacada (featured image) setada no editor do post.

    Tente aplicar e qualquer coisa nos retorne.

    Criador do tópico Ana Liziane

    (@ana-liziane)

    Olá, Everaldo. Coloquei, mas infelizmente não deu certo. Esse é o meu código do single.php

    <?php get_header(); ?>

    <div id=”content” >

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <div class=”title”>
    <h2>” rel=”bookmark” title=” “<?php the_title(); ?>”><?php the_title(); ?></h2>
    </div>

    <div class=”postmeta”>
    <span class=”author”>Posted by <?php the_author(); ?> </span>
    <span class=”clock”> Posted on <?php the_time(‘M – j – Y’); ?></span>
    <span class=”comm”><?php comments_popup_link(‘0 Comment’, ‘1 Comment’, ‘% Comments’); ?></span>
    </div>

    <div class=”entry”>
    <?php the_content(‘Read the rest of this entry »’); ?>

    <div class=”clear”></div>
    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
    </div>

    <div class=”singleinfo”>
    <span class=”category”>Categories: <?php the_category(‘, ‘); ?> </span>
    </div>

    </div>

    <?php comments_template(); ?>
    <?php endwhile; else: ?>

    <h1 class=”title”>Not Found</h1>
    <p>I’m Sorry, you are looking for something that is not here. Try a different search.</p>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Esse é o meu teste http://analiziane*fanzoom*net/
    Muito obrigado.

    Visitei o endereço que mandou. Você colocou o <?php the_post_thumbnail(); ?> e não aconteceu nada? Você setou uma imagem no admin para esse post?

    Criador do tópico Ana Liziane

    (@ana-liziane)

    Exato! Coloquei, mas não aconteceu nada, veja como está o código

    <?php get_header(); ?>

    <div id=”content” >

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <div class=”title”>
    <h2>” rel=”bookmark” title=” “<?php the_post_thumbnail(); ?> <?php the_title(); ?>”><?php the_title(); ?></h2>
    </div>

    <div class=”postmeta”>
    <span class=”author”>Posted by <?php the_author(); ?> </span>
    <span class=”clock”> Posted on <?php the_time(‘M – j – Y’); ?></span>
    <span class=”comm”><?php comments_popup_link(‘0 Comment’, ‘1 Comment’, ‘% Comments’); ?></span>
    </div>

    <div class=”entry”>
    <?php the_content(‘Read the rest of this entry »’); ?>

    <div class=”clear”></div>
    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
    </div>

    <div class=”singleinfo”>
    <span class=”category”>Categories: <?php the_category(‘, ‘); ?> </span>
    </div>

    </div>

    <?php comments_template(); ?>
    <?php endwhile; else: ?>

    <h1 class=”title”>Not Found</h1>
    <p>I’m Sorry, you are looking for something that is not here. Try a different search.</p>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Editei seu código e colei aqui: http://pastebin.com/RjvvrWmE

    Veja se agora funciona. Lembre-se de setar uma imagem no admin desse post, tudo bem?

Visualizando 5 respostas - 1 até 5 (de um total de 5)
  • O tópico ‘Imagens em destaque como http://samclaflin.com.br/’ está fechado para novas respostas.