← WordPress

[Ajuda] remover imagem de destaque de um post

Lida 20248 vezes

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


Boas noites, será possível retirar a imagem em destaque de um post, quando clicamos em ler mais?
Obrigado,
Cumprimentos
Offline

Fernando Augusto 
Membro
Mensagens 922 Gostos 0
Feedback +1

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

Coloca o single.php é mais fácil
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

Eis o código do single.php

Código: [Seleccione]
<?php get_header('single'); ?>
<div id="body" class="single">                 
<?php if ( get_option('layout') == 'right_sidebar'  ) echo '<div id="content" style="float:left;margin-left:22px;">'; else echo '<div  id="content" style="float:right;margin-right:42px;">';?> 
           <?php if (have_posts()) : ?>
            <?php while (have_posts()) : the_post(); ?>           
<div class="postMain"></div>
<div class="post">
<div class="date_title">
<div class="date_back">
<div class="month"><?php the_time('M'?></div>
<div class="day"><?php the_time('d'?></div>
</div>                     
  <h1><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
</div>
 <?php if ( has_post_thumbnail() ) {
$mypostimage the_post_thumbnail'large', array('class' => 'featsingle' 'alt' => get_the_title() , 'title' => get_the_title() ));
the_content(); } else { the_content(); } ?>

                <div class="postMeta"><?php the_tags('Tags: '', ''<br />'); ?> <?php _e("Posted in ","language"); ?> <?php the_category(', '?> <br /> <?php _e("By ","language"); ?> <?php the_author_posts_link() ?><br/><?php _e("Comments: ","language"); ?> <?php comments_popup_link('0 &#38;#187;''1 &#38;#187;''% &#38;#187;'); ?></div>
                <div style="clear:both;"></div>
                </div>                            
                <div style="clear:both">
                <div class="postFoot"></div>
                </div>
                <?php endwhile;  ?>
<div class="commentsMain">
                <?php comments_template(); ?>
</div> 
<?php else : ?>
<?php endif; ?>
</div>           
<?php get_sidebar(); ?>
<?php get_footer(); ?>           
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

Testa assim:

Código: [Seleccione]
<?php get_header('single'); ?>
<div id="body" class="single">                
<?php if ( get_option('layout') == 'right_sidebar'  ) echo '<div id="content" style="float:left;margin-left:22px;">'; else echo '<div  id="content" style="float:right;margin-right:42px;">';?>  
           <?php if (have_posts()) : ?>
            <?php while (have_posts()) : the_post(); ?>          
<div class="postMain"></div>
<div class="post">
<div class="date_title">
<div class="date_back">
<div class="month"><?php the_time('M'?></div>
<div class="day"><?php the_time('d'?></div>
</div>                      
  <h1><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
</div>
 <?php the_content();  ?>
                <div class="postMeta"><?php the_tags('Tags: '', ''<br />'); ?> <?php _e("Posted in ","language"); ?> <?php the_category(', '?> <br /> <?php _e("By ","language"); ?> <?php the_author_posts_link() ?><br/><?php _e("Comments: ","language"); ?> <?php comments_popup_link('0 &#38;#187;''1 &#38;#187;''% &#38;#187;'); ?></div>
                <div style="clear:both;"></div>
                </div>                            
                <div style="clear:both">
                <div class="postFoot"></div>
                </div>
                <?php endwhile;  ?>
<div class="commentsMain">
                <?php comments_template(); ?>
</div>  
<?php else : ?>
<?php endif; ?>
</div>            
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Offline

Fernando Augusto 
Membro
Mensagens 922 Gostos 0
Feedback +1

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

O que o Ricardo pôs deve resultar
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

Já agora, se quiseres saber o que alterei foi o seguinte:

Código: [Seleccione]
<?php if ( has_post_thumbnail() ) {
$mypostimage the_post_thumbnail'large', array('class' => 'featsingle' 'alt' => get_the_title() , 'title' => get_the_title() ));
the_content(); } else { the_content(); } ?>

Por:

Código: [Seleccione]
<?php the_content(); ?>
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

Resultou na perfeição, muito obrigado
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

Resultou na perfeição, muito obrigado

Ainda bem, isso é que interessa ;)
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


So mais uma pergintinha, como tiro o texto ARTICLES IN CATEGORY: ESTABLECIMENTOS?

Obrigado,
Cumps
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

Verifica se tens um ficheiro category.php , se tiveres coloca aqui o código sff.
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

Template de categorias (category.php)
   
Código: [Seleccione]
<?php get_header('single'); ?>
<div id="body" class="single">                 
<?php if ( get_option('layout') == 'right_sidebar'  ) echo '<div id="content" style="float:left;margin-left:22px;">'; else echo '<div  id="content" style="float:right;margin-right:42px;">';?>

     <?php if (have_posts()) : ?>
<?php $post $posts[0];?>
<?php  if (is_month())  ?>
<div class="postMain"></div>
<div class="postcom">
<p class="taghead"><?php single_cat_title (_e('Articles in Category: ',"language")); ?></p>
</div><div style="clear:both"></div>
<div class="postFoot"></div>
<?php while (have_posts()) : the_post(); ?>
<div class="postMain"></div>
<div class="post">                 
<div class="date_title">
<div class="date_back">
<div class="month"><?php the_time('M'?></div>
<div class="day"><?php the_time('d'?></div>
</div>                       
  <h2><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
</div>           
<?php if ( has_post_thumbnail() ) {
$mypostimage the_post_thumbnail'eventthumb', array('class' => 'eventthumb' 'alt' => get_the_title() , 'title' => get_the_title() ));
the_excerpt();} else { echo'<a href="'.get_permalink().'">'.category_image($post->ID,'medium').'</a>';
the_excerpt();  } ?>

<div style="clear:both;"></div>
               </div>                            
               <div style="clear:both">
                <div class="postFoot"></div>
                </div>
                <?php endwhile;  ?>
  <div class="navigation"><p><?php posts_nav_link('&#38;#8734;','Next &raquo;&raquo;',' &laquo;&laquo; Previous'); ?></p></div>
<?php else : ?>
<?php endif; ?>
</div>           
<?php get_sidebar(); ?>
<?php get_footer(); ?>           
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

Se quiseres manter aquele fundo escuro, retira apenas o seguinte:

Código: [Seleccione]
<p class="taghead"><?php single_cat_title (_e('Articles in Category: ',"language")); ?></p>
Se quiseres retirar o texto e o fundo, retiras o seguinte:

Código: [Seleccione]
<div class="postMain"></div>
 <div class="postcom">
  <p class="taghead"><?php single_cat_title (_e('Articles in Category: ',"language")); ?></p>
 </div>
 <div style="clear:both"></div>
<div class="postFoot"></div>

Em principio será isso, como não consigo ver a theme, não tenho a certeza se é esse código todo que retiras (na 2ª opção), faz sempre backup antes de alterares.
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

Se quiseres manter aquele fundo escuro, retira apenas o seguinte:

Código: [Seleccione]
<p class="taghead"><?php single_cat_title (_e('Articles in Category: ',"language")); ?></p>
Se quiseres retirar o texto e o fundo, retiras o seguinte:

Código: [Seleccione]
<div class="postMain"></div>
 <div class="postcom">
  <p class="taghead"><?php single_cat_title (_e('Articles in Category: ',"language")); ?></p>
 </div>
 <div style="clear:both"></div>
<div class="postFoot"></div>

Em principio será isso, como não consigo ver a theme, não tenho a certeza se é esse código todo que retiras (na 2ª opção), faz sempre backup antes de alterares.

Ficou perfeito, muito obrigado. Já fique a perceber um pouco mais das instruções php do wordpress :D

Só uma ultima questão, é possível, apresentar no pagina principal só artigos publicados numa certa categoria?
Obrigada, com os melhores cumprimentos,
Cláudio Hilário
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

Ficou perfeito, muito obrigado. Já fique a perceber um pouco mais das instruções php do wordpress :D

Só uma ultima questão, é possível, apresentar no pagina principal só artigos publicados numa certa categoria?
Obrigada, com os melhores cumprimentos,
Cláudio Hilário

Sim é, coloca ai o código do teu index.php sff.
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

Aqui está o código index.php:

Código: [Seleccione]
<?php get_header(); ?>
<div id="show">            
<div id="showcase"  class="showcase">
<?php query_posts(array('post_type'=>'featured','posts_per_page' => '18'));?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post();
$large wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$thumbnail wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail');?>

<div> <a href="<?php the_permalink();?>"><img src="<?php echo $large[0]; ?>" alt="<?php the_title();?>" /></a>
<div class="showcase-thumbnail">
<img src="<?php echo $thumbnail[0]; ?>" alt="<?php the_title();?>"/>
<div class="showcase-thumbnail-cover"></div>
</div></div>
<?php endwhile;?>
<?php wp_reset_query();?>
</div>
<div style="clear:both"></div>    
        </div>
<div style="clear:both"></div>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Photo Gallery') ) : ?><div style="clear:both"></div>
<?php endif; ?>
<div id="body">
<?php
if ( function_exists('dynamic_sidebar') )
echo 
'<div id="centerwidgets">';
dynamic_sidebar('Widgets Home');
echo 
'<div style="clear:both"></div></div>';
?>
           
<?php if ( get_option('layout') == 'right_sidebar'  ) echo '<div id="content" style="float:left;margin-left:22px;">'; else echo '<div  id="content" style="float:right;margin-right:42px;">';?>
   
    <?php if (have_posts()) :while (have_posts()) :the_post();?>    
<div class="postMain"></div>
<div class="post">
  <div class="date_title">
<div class="date_back">
<div class="month"><?php the_time('M'?></div>
<div class="day"><?php the_time('d'?></div>
</div>                      
  <h2><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
</div>
<?php if ( has_post_thumbnail() ) {
$mypostimage the_post_thumbnail'thumbnail', array('class' => 'homethumb' 'alt' => get_the_title() , 'title' => get_the_title() ));
the_excerpt('</br></br><span class="fullarticle">FULL ARTICLE &raquo;</span>');} else {the_excerpt('</br></br><span class="fullarticle">FULL ARTICLE &raquo;</span>'); } ?>

<div class="postMeta"><?php _e("Posted in ","language"); ?> <?php the_category(', '?> </div>
                <div style="clear:both;"></div>
                </div>                            
                <div style="clear:both"></div>
                <div class="postFoot"></div>
<?php endwhile;endif;  ?>
  <div class="navigation"><p><?php posts_nav_link('&#38;#8734;','Next &raquo;&raquo;',' &laquo;&laquo; Previous'); ?></p>
</div>
</div>            
<?php get_sidebar(); ?>  
<?php get_footer(); ?>