• Hola amigos,
    He leído foros sobre cómo quitar la «featured picture» del interior del post, para que solo aparezca en la página de inicio o en la galería. En casi todos coinciden que hay que entrar en el editor de apariencia, en single post (single. php), eliminar el renglón que contenga thumbnail. Lo que ocurre es que en mi código no aparece thumbnail. Esto es lo que dice:

    <?php
    /**
     * The template for displaying all single posts.
     *
     * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
     *
     * @package resi
     */
    
    get_header(); ?>
    
    <?php if ( 'option1' == resi_sanitize_index_content( get_theme_mod( 'resi_blog_sidebar_setting', 'option1' ) ) ) : //Fullwidth and no sidebar ?>
    	<div class="grid grid-pad solid-background single-fullwidth">
    <?php else : ?>
    	<div class="grid grid-pad solid-background single-sidebar">
    <?php endif; ?>
    
    	<?php if ( 'option1' == resi_sanitize_index_content( get_theme_mod( 'resi_blog_sidebar_setting', 'option1' ) ) ) : //Fullwidth and no sidebar ?>
    		<div class="col-1-1">
        <?php else : ?>
    		<div class="col-9-12">
    	<?php endif; ?>
    
            <div id="primary" class="content-area">
                <main id="main" class="site-main" role="main">
    
                <?php while ( have_posts() ) : the_post(); ?>
    
                    <?php get_template_part( 'template-parts/content', 'single' ); ?>
    
                    <?php the_post_navigation(); ?>
    
                    <?php
                        // If comments are open or we have at least one comment, load up the comment template.
                        if ( comments_open() || get_comments_number() ) :
                            comments_template();
                        endif;
                    ?>
    
                <?php endwhile; // End of the loop. ?>
    
                </main><!-- #main -->
            </div><!-- #primary -->
    
    	<?php if ( 'option1' == resi_sanitize_index_content( get_theme_mod( 'resi_blog_sidebar_setting', 'option1' ) ) ) : //Fullwidth and no sidebar ?>
    		</div>
        <?php else : ?>
    		</div>
    	<?php endif; ?> 
    
        <?php if ( 'option1' == resi_sanitize_index_content( get_theme_mod( 'resi_blog_sidebar_setting', 'option1' ) ) ) : //Fullwidth and no sidebar ?>
    
    	<?php else : ?>
    		<?php get_sidebar(); ?>
    	<?php endif; ?>
    
    <?php if ( 'option1' == resi_sanitize_index_content( get_theme_mod( 'resi_blog_sidebar_setting', 'option1' ) ) ) : //Fullwidth and no sidebar ?>
    	</div>
    <?php else : ?>
    	</div>
    <?php endif; ?>
    
    <?php get_footer(); ?>

    Os agradecería vuestra ayuda, ya que soy nueva en esto, y con el tema de códigos y programación estoy bastante perdida.
    Gracias!

    • Este debate fue modificado hace 4 años, 9 meses por Fernando Tellado. Razón: Etiquetado correcto del código
Viendo 3 respuestas - de la 1 a la 3 (de un total de 3)
  • Hola Laura,

    Tienes una línea:

    <?php get_template_part( ‘template-parts/content’, ‘single’ ); ?>

    que te indica que hay una carpeta con ese nombre, y un archivo content.php que se carga (como si fuera un include) dentro de tu single.php. En ese archivo tendrás la llamada al thumbnail

    Saludos

    Iniciador del debate lauragagodeval

    (@lauragagodeval)

    Muchísimas gracias Pablo por tu respuesta,

    Voy a ver si funciona!

    Hola!
    Me pasa lo mismo. Quiero poner la miniatura pero no quiero que se me duplique en el post la imagen…¿Cómo puedo ocultarla?

    Lo único que he encontrado es es to en el archivo post-template.php

    CÓDIGO:

    <?php
    /**
    * Single blog post template.
    */

    global $pexeto_page;
    $format = get_post_format();
    $add_post_class = is_single() ? ‘blog-single-post’ : ‘blog-non-single-post’;
    $add_post_class.=’ theme-post-entry’;
    ?>
    <div id=»post-<?php the_ID(); ?>» <?php post_class( $add_post_class ); ?>>

    <?php

    if ( $format == ‘quote’ ) {
    //QUOTE POST FORMAT
    ?>
    <span class=»post-type-icon-wrap»><span class=»post-type-icon»></span></span>

    <?php the_content(); ?>

    <?php
    }elseif ( $format == ‘aside’ ) {
    //ASIDE POST FORMAT
    ?>
    <span class=»post-type-icon-wrap»><span class=»post-type-icon»></span></span>
    <aside><?php the_content(); ?></aside>
    <?php
    }else {
    //ALL OTHER POST FORMATS
    $hide_thumbnail=( isset( $pexeto_page[«hide_thumbnail»] )&&$pexeto_page[«hide_thumbnail»] )?true:false;
    $thumb_class=»;
    if ( (!$format && !has_post_thumbnail()) || $hide_thumbnail ) {
    $thumb_class=’ no-thumbnail’;
    }
    ?>

    <?php
    //PRINT HEADER OF POST DEPENDING ON ITS FORMAT

    if(!$format || $format==’video’){
    $columns = isset($pexeto_page[‘columns’]) ? $pexeto_page[‘columns’] : 1;
    $img_size = pexeto_get_image_size_options($columns, ‘blog’);
    }

    if ( $format == ‘gallery’ ) {
    //PRINT A GALLERY
    locate_template( array( ‘includes/slider-nivo-post-gallery.php’ ), true, false );
    }elseif ( $format == ‘video’ ) {
    ?>
    <div class=»post-video-wrapper»>
    <div class=»post-video»>
    <?php
    $video_url = pexeto_get_single_meta( $post->ID, ‘video’ );
    if ( $video_url ) {
    pexeto_print_video( $video_url, $img_size[‘width’] );
    }
    ?>
    </div>
    </div>
    <?php
    }else {
    //PRINT AN IMAGE
    if ( has_post_thumbnail() && !$hide_thumbnail ) { ?>
    <div class=»blog-post-img img-loading» style=»min-width:<?php echo $img_size[‘width’]; ?>px; min-height:<?php echo $img_size[‘height’] ?>px;»>
    <?php if ( !is_single() ) {?>«><?php }

    $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘full’ ); ?>

    » />
    <?php
    if ( !is_single() ) { ?>
    <?php } ?>
    </div>
    <?php
    }
    }
    ?>
    <div class=»post-content<?php echo $thumb_class; ?>»>
    <div class=»post-title-wrapper»>
    <?php $htag = is_single()?’h1′:’h2′; ?>
    <<?php echo $htag; ?> class=»post-title entry-title»>
    <?php if ( !is_single() ) { ?>
    «><?php the_title(); ?>
    <?php }else {
    the_title();
    } ?>
    </<?php echo $htag; ?>>

    </div>
    <div class=»clear»></div>

    <div class=»post-content-content»>

    <?php
    //PRINT THE CONTENT
    $excerpt=( isset( $pexeto_page[‘excerpt’] ) && $pexeto_page[‘excerpt’] ) ? true : false;
    if ( !$excerpt && pexeto_option( ‘post_summary’ )!=’excerpt’ || is_single() ) {
    ?><div class=»entry-content»><?php
    the_content( » ); ?>
    </div>
    <div class=»clear»></div>
    <?php
    if ( !is_single() ) {
    $ismore = @strpos( $post->post_content, ‘<!–more–>’ );
    if ( $ismore ) {?> » class=»read-more»><?php _e( ‘Ver más’, ‘pexeto’ ); ?><span class=»more-arrow»>›</span>
    <?php
    }
    } else {
    wp_link_pages();
    }
    }else {
    ?><div class=»entry-summary»><?php
    the_excerpt(); ?>
    </div>

    » class=»read-more»>
    <?php _e( ‘Read More’, ‘pexeto’ ); ?>
    <span class=»more-arrow»>›</span>

    <?php
    }?>
    <div class=»clear»></div>
    </div>
    </div>
    <?php

    //PRINT POST INFO

    $hide_sections=pexeto_option( ‘exclude_post_sections’ );

    if ( sizeof( $hide_sections )!=4 ) {
    ?>

    <div class=»post-info»>
    <span class=»post-type-icon-wrap»><span class=»post-type-icon»></span></span>
    <?php
    //PRINT THE POST INFO (CATEGORY, AUTHOR, DATE AND COMMENTS)
    if ( !in_array( ‘category’, $hide_sections ) && get_the_category( $post->ID ) ) {?>
    <span class=»no-caps»>
    <?php _e( ‘in’, ‘pexeto’ ); ?>
    </span><?php the_category( ‘ / ‘ );?>
    <?php }

    if ( !in_array( ‘author’, $hide_sections ) ) {?>
    <span class=»no-caps post-autor vcard author»>
     <?php _e( ‘by’, ‘pexeto’ ); ?>
    «>
    <?php the_author(); ?>

    </span>
    <?php }

    if ( !in_array( ‘date’, $hide_sections ) ) { ?>
    <span class=»post-date»>
    <?php echo pexeto_get_post_date_html(); ?>
    </span>
    <?php }

    if ( !in_array( ‘comments’, $hide_sections ) ) {?>
    <span class=»comments-number»>
    #comments»>
    <?php comments_number( ‘0’, ‘1’, ‘%’ ); ?>
    <span class=»no-caps»><?php _e( ‘comments’, ‘pexeto’ ); ?></span>

    </span>
    <?php } ?>
    </div>

    <?php
    //PRINT SHARING
    if ( is_single() ) {
    echo pexeto_get_share_btns_html( $post->ID, ‘post’ );
    }

    // PRINT POST TAGS
    if ( is_single() ) {
    the_tags( ‘<span class=»post-tags»><span class=»post-tag-title»>’.__( ‘Post tags’, ‘pexeto’ ).'</span>’, », ‘</span>’ );
    } ?>

    <?php } //end if
    } ?>
    <div class=»clear»></div>
    </div>

    ¿Qué tendría que quitar o modificar? ¿Alguien me echa un cable? Gracias!

Viendo 3 respuestas - de la 1 a la 3 (de un total de 3)
  • El debate ‘Cómo eliminar la imagen principal del interior del post.’ está cerrado a nuevas respuestas.