← WordPress

[Ajuda] remover imagem de destaque de um post

Lida 20591 vezes

Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Pelo que percebi o teu site mostra 2 tipos de posts na home, os "featured" e os restantes depois correcto? Onde queres alterar? Os featured ou os restantes? Se for os restantes procura pelo seguinte:

Código: [Seleccione]
<?php if (have_posts()) :while (have_posts()) :the_post();?>    

(está junto ao <div class="postMain"></div> quase no fundo do código do index.php)

E adiciona antes desse bloco de código o seguinte:

Código: [Seleccione]
<?php query_posts('cat=1'); ?>  

Ficando:

Código: [Seleccione]
<?php query_posts('cat=1'); ?>
<?php if (have_posts()) :while (have_posts()) :the_post();?>    

NOTA: cat=1 quer dizer que vai mostrar todos os posts da categoria com ID 1, agora é só veres no back-end do Wordpress o ID da categoria que queres mostrar.
Offline

HilarYo 
Membro
Mensagens 188 Gostos 2
Troféus totais: 20
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Pelo que percebi o teu site mostra 2 tipos de posts na home, os "featured" e os restantes depois correcto? Onde queres alterar? Os featured ou os restantes? Se for os restantes procura pelo seguinte:

Código: [Seleccione]
<?php if (have_posts()) :while (have_posts()) :the_post();?>    

(está junto ao <div class="postMain"></div> quase no fundo do código do index.php)

E adiciona antes desse bloco de código o seguinte:

Código: [Seleccione]
<?php query_posts('cat=1'); ?>  

Ficando:

Código: [Seleccione]
<?php query_posts('cat=1'); ?>
<?php if (have_posts()) :while (have_posts()) :the_post();?>    

NOTA: cat=1 quer dizer que vai mostrar todos os posts da categoria com ID 1, agora é só veres no back-end do Wordpress o ID da categoria que queres mostrar.

e mais que uma categoria também dá?
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

e mais que uma categoria também dá?

Sim, basta adicionar os ID's, exemplo:

cat=1,2,3,4 ...etc ou também podes excluir categorias, cat=1,2,3,4,-10,-15 (aqui exclui a categoria com ID 10 e 15)
Offline

HilarYo 
Membro
Mensagens 188 Gostos 2
Troféus totais: 20
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Sim, basta adicionar os ID's, exemplo:

cat=1,2,3,4 ...etc ou também podes excluir categorias, cat=1,2,3,4,-10,-15 (aqui exclui a categoria com ID 10 e 15)

Muito OBRIGADO
Deu-me uma grande ajuda
Cumprimentos
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Muito OBRIGADO
Deu-me uma grande ajuda
Cumprimentos

De nada, se for preciso mais alguma ajuda e eu souber é só perguntar ;)

Boa sorte com o projecto.
Offline

HilarYo 
Membro
Mensagens 188 Gostos 2
Troféus totais: 20
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Código: [Seleccione]
<?php get_header(); ?>
<?php $layout get_option('dancefloor_theme_options_layout'); $theme_layout $layout['design']; if (!$theme_layout$theme_layout "left";?>
<div class="container-<?php echo $theme_layout ?>">
<div class="contents-<?php echo $theme_layout ?>" style="padding-top:16px;">
<div class="post-wrapper">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<h2 class="title"><a href="<?php the_permalink() ?>"><?php the_title();?></a></h2>
<div class="post-container">
<h4 class="post-date"><?php the_time('M'); ?><span><?php the_time('j'); ?></span></h4>
<div class="post-data">
<?php 
$video_source get_post_meta($post->ID'video_meta_box_source'true);
$video_id get_post_meta($post->ID'video_meta_box_videoid'true);
if(($video_source == "vimeo") && !empty($video_id)){
?>

<iframe src="http://player.vimeo.com/video/<?php echo $video_id?>?title=0&amp;portrait=0&amp;color=e275c7" width="554" height="300" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>
<?php } elseif(( $video_source == "youtube") && !empty($video_id)){ ?>
<iframe width="554" height="300" src="http://www.youtube.com/embed/<?php echo $video_id?>" frameborder="0" allowfullscreen></iframe>
<?php  }
if(has_post_thumbnail()) {
$image_id get_post_thumbnail_id();
$image_url wp_get_attachment_url($image_id);
?>

<div class="featured-pic-wrapper">
<?php the_post_thumbnail('single');?>
</div>
<?php
}
?>

<?php the_content();?>
<div class="post-tags">
<p><?php the_tags('Posted in: '', '' '); ?></p>
</div>
<?php endwhile; ?>
<div class="comments-wrapper">
<div class="comments-head">
<h4><?php comments_number('No Comments''One Comment''% Comments' );?>:</h4>
<p><a href="#comment"><?php _e('Add a Comment','language');?></a></p>
</div>
                              <?php comments_template(); ?>
                        </div><!--comments-wrapper closed -->
                  </div>
</div>
      </div><!-- post wrapper closed -->     
</div><!-- content closed -->
<?php get_sidebar(); ?> 
</div><!-- container closed -->
<?php get_footer(); ?>   

Neste código, como tiro as imagens em destaque algém dá uma ajudinha!?
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Remove o seguinte código:

Código: [Seleccione]
<div class="featured-pic-wrapper">
<?php the_post_thumbnail('single');?>
</div>
Offline

HilarYo 
Membro
Mensagens 188 Gostos 2
Troféus totais: 20
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Obrigado, funcionou na perfeição, agora tenho um outro erro na pagina categorias:



Queria tirar a imagem grande....

O codigo de category.php é:
Código: [Seleccione]
<?php get_header(); ?>
<?php $layout get_option('dancefloor_theme_options_layout'); $theme_layout $layout['design']; if (!$theme_layout$theme_layout "left";?>
<div class="container">
      <div class="contents-<?php echo $theme_layout ?>" style="padding-top:16px;">
            <div class="post-wrapper">
            <div class="post-container">
                  <div class="post-data">
                  <h2><?php single_cat_title(__('','language')); ?></h2>
                  </div>
                  </div>
            </div><!-- post wrapper closed -->
            <?php get_template_part'loop' ); ?>
            </div> <!-- content closed -->
            <?php get_sidebar(); ?>
</div><!-- container closed -->
<?php get_footer(); ?>

Há alguma solução possível?
Obrigada
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Não é esse o código, coloca aqui o código do loop:

Código: [Seleccione]
<?php get_template_part'loop' ); ?>
Talvez seja o loop.php
Offline

Filipe Santos 
Membro
Mensagens 201 Gostos 5
Feedback +7

Troféus totais: 19
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts 10 Posts

Aproveito este tópico para ver se conseguem-me ajudar com um problema que esta a dar cabo da minha cabeça.

Quando faço um post coloco uma imagem dentro do post e depois coloco outra imagem na definição de imagem para aparecer um thumbnail na home page, mas o problema é que me està a aparecer também esse thumbnail no post, ou seja, no post aparece o thumbanil e a outra imagem que coloquei no post.

Como devo fazer para aparecer o thumbnail só na home page do site?

Agradeço a vossa ajuda.
Offline

Pedro Lopes 
Beta tester
Mensagens 3568 Gostos 18
Feedback +6

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Aproveito este tópico para ver se conseguem-me ajudar com um problema que esta a dar cabo da minha cabeça.

Quando faço um post coloco uma imagem dentro do post e depois coloco outra imagem na definição de imagem para aparecer um thumbnail na home page, mas o problema é que me està a aparecer também esse thumbnail no post, ou seja, no post aparece o thumbanil e a outra imagem que coloquei no post.

Como devo fazer para aparecer o thumbnail só na home page do site?

Agradeço a vossa ajuda.

Cria um tópico para ti!
Offline

HilarYo 
Membro
Mensagens 188 Gostos 2
Troféus totais: 20
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Não é esse o código, coloca aqui o código do loop:

Código: [Seleccione]
<?php get_template_part'loop' ); ?>
Talvez seja o loop.php

O Código do loop.php é:

Código: [Seleccione]
<?php 
if (
have_posts()) : while (have_posts()) : the_post(); 
?>

<div class="post-wrapper">
<h2 class="title"><a href="<?php the_permalink() ?>"><?php the_title();?></a></h2>
<div class="post-container">
<h4 class="post-date"><?php the_time('M'); ?><span><?php the_time('j'); ?></span></h4>   
<?php 
if(has_post_thumbnail()) {
$image_id get_post_thumbnail_id();
$image_url wp_get_attachment_url($image_id);
?>

            <div class="post-thumb-container">
<a href="<?php the_permalink() ?>">
<?php gorilla_img('home_thumb');?>
</a>
            </div>
            <?php
} else{ 
$image_url gallery_first_image();
if($image_url)
{
?>

<div class="post-thumb-wrapper">
<a href="<?php the_permalink() ?>"><?php gorilla_img('home_thumb');?></a>
</div>
<?php
}
 }
 ?>

            <div class="post-data">
            <?php
$content =  get_the_content();
echo word_trim$content,45'...' );
?>

<div class="btn-wrapper">
<a class="read-more-btn" href="<?php the_permalink() ?>"><?php _e('Read More','language');?></a>
<p><?php the_tags('Posted in: '', '' '); ?></p>
</div>
            </div>
      </div>
</div><!-- post wrapper closed -->
<?php endwhile; else: ?>
<div class="post-wrapper">
      <div class="post-container">
            <div class="post-data">
                  <h2><?php _e('No Results Found.','language');?></h2>
            </div>
      </div>
</div><!-- post wrapper closed -->
<?php endif; ?>
<?php theme_pagination$wp_query->max_num_pages); ?>
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Código: [Seleccione]
<?php 
if(has_post_thumbnail()) {
$image_id get_post_thumbnail_id();
$image_url wp_get_attachment_url($image_id);
?>

            <div class="post-thumb-container">
<a href="<?php the_permalink() ?>">
<?php gorilla_img('home_thumb');?>
</a>
            </div>
            <?php
} else{ 
$image_url gallery_first_image();
if($image_url)
{
?>

<div class="post-thumb-wrapper">
<a href="<?php the_permalink() ?>"><?php gorilla_img('home_thumb');?></a>
</div>
<?php
}
 }
 ?>

É esse o código, isso vai retirar a thumbnail do loop, depois terás de inserir manualmente a imagem no artigo.

PS - Vê se esse loop é do single.php ou se é do index/home, porque se for o mesmo para o index e single não sei se será isso que queres.
Offline

HilarYo 
Membro
Mensagens 188 Gostos 2
Troféus totais: 20
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

O que eu realmente queria era manter o thumbnail, e que as imagens introduzidas num post por exemplo n aparecessem, ou seja aparecer só o thumbnail com um pequeno texto ao lado....
Offline

animearashi 
Membro
Mensagens 6 Gostos 0
Troféus totais: 6
Trófeus: (Ver todos)
Combination Topic Starter Level 1 First Post Second year Anniversary One year Anniversary

Tenho esse problema ajudem-me pf.

Meu código single.php:

Código: [Seleccione]
<?php
/**
 * The Template for displaying all single posts.
 *
 * @package metro-creativex
 */
get_header(); ?>


<?php  while ( have_posts() ) : the_post(); ?>
<?php
do_action('single_header');
?>

</div><!--/topside-->
<?php
do_action('metro_customizr_single_header');
?>

<div id="content">
<div <?php post_class(); ?>>
<?php 
$metro_creativex_posttitle get_the_title();
$metro_creativex_feat_image wp_get_attachment_image_srcget_post_thumbnail_id$post->ID ), 'single-post-thumbnail' );
if(isset($metro_creativex_feat_image[0])):
echo '<div class="post_img"><img src='.$metro_creativex_feat_image[0].' alt="'.$metro_creativex_posttitle.'"></div>';
endif;

the_content(); 
wp_link_pages();
edit_post_link__('Edite''metro-creativex'));
?>

<div class="clearfix"></div>
<?php 
if(has_tag()):
echo '<div class="tags">';
the_tags();
echo '</div>';
endif;
?>

</div><!--/post-->
<?php metro_creativex_pagination(); ?>
<?php comments_template(); ?>
</div><!-- /content -->
<?php endwhile; ?>
<?php do_action('metro_customizr_right_sidebar');?>
<?php get_footer(); ?>

O erro podem ver aqui como ele é : http://www.animearashi.net/torneio-guilty-gear-xrdstreet-fighter-v-dia-20-marco-na-spawn-point/