Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

Que no me aparezca

Estas en el tema de Que no me aparezca en el foro de WordPress en Foros del Web. Hola quiero que en el index no me aparezca la imagen "no thumbnail" en ningun post y me estoy haciendo un lio, deseo que no ...
  #1 (permalink)  
Antiguo 11/04/2012, 12:10
 
Fecha de Ingreso: junio-2008
Ubicación: www.descuentorural.com
Mensajes: 22
Antigüedad: 15 años, 10 meses
Puntos: 0
Que no me aparezca

Hola quiero que en el index no me aparezca la imagen "no thumbnail" en ningun post y me estoy haciendo un lio, deseo que no aparezca y que lo que escriba aparezca en todo el espacio.


tengo esto en index
Código HTML:
Ver original
  1. <?php
  2. /*
  3. Template Name: Index Page
  4. */
  5. ?>
  6. <?php get_header(); ?>
  7.  
  8. <div id="content" class="content-group content-index">
  9.     <div id="content-pad">
  10.         <div class="post-group append-clear">
  11.  
  12.             <div class="content-title">
  13.                 <h2><?php echo __('Recent Posts', PADD_THEME_SLUG); ?></h2>
  14.             </div>
  15.             <?php get_template_part('loop','index'); ?>
  16.             <?php
  17.                 if (!is_singular()) :
  18.                     Padd_Theme_PageNavigation::render();
  19.                 endif;
  20.             ?>
  21.         </div>
  22.     </div>
  23. </div>
  24.  
  25. <?php get_sidebar(); ?>




y esto en loop.php

Código HTML:
Ver original
  1. <?php
  2. /**
  3. * The Loop
  4. *
  5. * Section dedicated for rendering the number of posts in which we will expect
  6. * to return at least one or more posts.
  7. *
  8. */
  9. ?>
  10.  
  11. <?php if (!have_posts()) : ?>
  12.  
  13. <div id="post-0" class="hentry post error404 not-found">
  14.     <div class="title">
  15.         <h2><?php echo __('Not Found', PADD_THEME_SLUG); ?></h2>
  16.     </div>
  17.     <div class="content">
  18.         <p><?php echo __('Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', PADD_THEME_SLUG); ?></p>
  19.     </div>
  20. </div>
  21.  
  22. <?php else : ?>
  23.  
  24.     <?php
  25.         $tag = 'h2';
  26.         add_filter('excerpt_length', 'padd_theme_hook_excerpt_index_length');
  27.     ?>
  28.     <?php while (have_posts()) : ?>
  29.         <?php the_post(); ?>
  30.         <div id="post-<?php the_ID(); ?>" <?php post_class('append-clear'); ?>>
  31.             <?php if ('post' == get_post_type()) : ?>
  32.             <div class="thumbnail">
  33.                 <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
  34.                     <?php
  35.                         $padd_image_def = get_template_directory_uri() . '/images/thumbnail.png';
  36.                         if (has_post_thumbnail()) {
  37.                         the_post_thumbnail(PADD_THEME_SLUG . '-thumbnail');
  38.                         } else {
  39.                             echo '<img class="image-thumbnail" alt="Default thumbnail." src="' . $padd_image_def . '" />';
  40.                         }
  41.                     ?>
  42.                 </a>
  43.             </div>
  44.             <div class="title">
  45.                 <<?php echo $tag;?>><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></<?php echo $tag; ?>>
  46.             </div>
  47.             <div class="excerpt">
  48.                 <?php padd_theme_share_button(); ?>
  49.                 <?php the_content();?>
  50.                
  51.                 </p>
  52.             </div>
  53.  
  54.             <div class="meta">
  55.                 <p>
  56.  
  57.                 </p>
  58.             </div>
  59.         </div>
  60.         <?php endif; ?>
  61.         <?php $i = ($i < 4) ? ++$i : 1; ?>
  62.     <?php endwhile; ?>
  63.     <?php
  64.         remove_filter('excerpt_length', 'padd_theme_hook_excerpt_index_length');
  65.     ?>
  66.  
  67. <?php endif;


me estoy volviendo loco. un saludo

Última edición por Nekko; 11/04/2012 a las 13:04
  #2 (permalink)  
Antiguo 11/04/2012, 12:11
 
Fecha de Ingreso: junio-2008
Ubicación: www.descuentorural.com
Mensajes: 22
Antigüedad: 15 años, 10 meses
Puntos: 0
Respuesta: Que no me aparezca

a mi web de prueba es http://www.aysconsultoriaturistica.es/prueba1

Un saludo.
  #3 (permalink)  
Antiguo 11/04/2012, 13:02
Avatar de Nekko
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Buenos Aires
Mensajes: 3.141
Antigüedad: 16 años, 1 mes
Puntos: 656
Respuesta: Que no me aparezca

Es mucho pedir que coloquen el código entre etiquetas [code][/code]?
Eso facilita la lectura y ayuda a que te respondan mas rápido.

EDIT: Ya te lo hice yo.

El código que tenés que modificar está aquí:

Código PHP:
Ver original
  1. $padd_image_def = get_template_directory_uri() . '/images/thumbnail.png';
  2.                         if (has_post_thumbnail()) {
  3.                         the_post_thumbnail(PADD_THEME_SLUG . '-thumbnail');
  4.                         } else {
  5.                             echo '<img class="image-thumbnail" alt="Default thumbnail." src="' . $padd_image_def . '" />';
  6.                         }

Tenés que indicar lo que querés que haga si no hay thumb luego del else.
__________________
Taller para crear themes wordpress desde cero | Presupuestos para trabajos particulares vía MP

Etiquetas: aparezca, php, post, themes
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:40.