Ayuda con Excerpt en Wordpress

  • Autor Autor robertfenyiner
  • Fecha de inicio Fecha de inicio
R

robertfenyiner

Curioso
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Hola ... compañeros de foro, soy nuevo y pido disculpas si este tema no va acá, mi situación es la siguiente, ando trabajando bajo un tema de Wordpress llamado Rule.. Rule | Retina Responsive Magazine WordPress Theme...

El problema es que ando trabajando en una web personal de descargas y demás, pero me he encontrado conque la imagen de post que se muestra trae el titulo y un pequeño resumen, he leído y algo tiene que ver con el excerpt, pero realmente no logro cuadrarlo bien, la idea es dejar la imagen y solo el titulo, y actualmente me sobra un espacio grande que hace perder mucho la gracia de la publicación ... adjunto una imagen, como pueden observar es demasiado grande ese espacio despues del titulo y me gustaria recortarlo ...


gracias por la ayuda .. que me puedan brindar
 

Adjuntos

  • fotoasubir.webp
    fotoasubir.webp
    59,5 KB · Visitas: 100
creo que deberias porner la URL para ver cual es el problema en si.. 🙂
 
Busca la linea que dija wp_excerpt o wp_content o algo asi en index, y eliminala.

En ocasiones un tema puede venir modificado y el nombre cambia, debes revisar el code para saber cual es.

Recuerda generar un respaldo d elo que edites.
 
Si nada mas estás usando el título, no necesitas la función teh_excerpt(). Como no eres claro en tu explicación y la imagen que muestras me parece correcta y sin problemas, sospecho que mas bien es un cuestión que tiene que ver con la maquetación del tema, más que con la programación.


Supongo que cada post que muestra está englobado en un div que tiene una altura mínima (min-height), por lo menos la parte dónde va el texto. La altura total del post es la suma de la imagen más la altura del texto, dígamosle así.

Puedes probar elminando la altura mínima y ver que resultados obtienes, o bien usando un valor menor.

Pero tienes que revisar tu hoja de estilos.
 
Hola .. gracias por responder.. esta la tengo de pruebas en un host gratuito Pulsa - ON mi duda es .. por ejemplo... mira el post de thor ... y mira los 3 puntos suspensivos que aparecen ... la idea es acortar eso ... dejar solo el titulo, es que se tira muy hacia abajo la franja blanca... sorry por no hablar en terminos tecnicos...
 
eso es CSS, por ejemplo podes quitar el margin-bottom de:
Insertar CODE, HTML o PHP:
#blog-entry .entry-content {
margin-bottom: 15px;
}
y tambien
Insertar CODE, HTML o PHP:
.entry-extra {
padding: 10px 0px;
line-height: 11px;
}
pero bueno checa bien como lo podes hacer.
PD: podrías poner el código de tu loop.
 
Ah... ahora si ...

busca teh_excerpt() o teh_content() y bórralos.
 
companeros muchas gracias por la ayuda... he seguido las instrucciones de ENZOZ... y he localizado en el archivo style.css las lineas que el me ha puesto .... y las he eliminado ...

#blog-entry .entry-content { margin-bottom: 0px; }

.entry-extra { padding: 1px 0px; line-height: 1px; }

eso elimina gran parte del sobrante blanco ... adjunto una imagen de como queda despues de eliminar las lineas ... ahora bien ....... si notan quedan los 3 puntos suspensivos y un poquitin de espacio.. ese como se eliminaria???

si necesitan ver algun archivo me dicen y se los pego ..


gracias
 

Adjuntos

  • despuesdeeditar.webp
    despuesdeeditar.webp
    69,4 KB · Visitas: 74
[MENTION=81520]robertfenyiner[/MENTION] pasa el código de tu loop, localizado en tu index.php o home.php depende de la plantilla.
 
<?php
/**
* The main template file.
*
* @package WordPress
* @subpackage Rule
* @since Rule 1.0
*/

get_header(); ?>

<?php
global $ct_options;

$pagination_type = stripslashes( $ct_options['ct_pagination_type'] );
$home_columns = stripslashes( $ct_options['ct_homepage_columns'] );
$home_sidebar = stripslashes( $ct_options['ct_homepage_sidebar'] );


if( $home_columns == '3 Columns' ) $ct_post_class = 'three_columns'; else
if( $home_columns == '4 Columns' ) $ct_post_class = 'four_columns'; else
if( $home_columns == '5 Columns' ) $ct_post_class = 'five_columns'; else
if( $home_columns == '1 Column + Sidebar' ) $ct_post_class = 'one_columns_sidebar'; else
if( $home_columns == '2 Columns + Sidebar' ) $ct_post_class = 'two_columns_sidebar'; else
if( $home_columns == '3 Columns + Sidebar' ) $ct_post_class = 'three_columns_sidebar'; else $ct_post_class = 'four_columns';
?>

<div id="content" class="container" role="main">
<div class="row-fluid">

<?php if( ($home_columns == '2 Columns + Sidebar') or ($home_columns == '3 Columns + Sidebar') or ($home_columns == '1 Column + Sidebar') ) : ?>
<?php if ( $home_sidebar == 'Right' ) : ?>
<div class="span8">
<?php else : ?>
<div class="span8 pull-right">
<?php endif; // $home_sidebar ?>
<?php else : ?>
<div class="span12">
<?php endif; // $home_columns ?>


<?php
global $query_string;

$homepage_category = stripslashes( $ct_options['ct_homepage_category'] );
$idObj = get_category_by_slug( $homepage_category );

if( !empty($idObj->term_id) ) $id = $idObj->term_id;
else $id = '';

query_posts( $query_string . '&cat=' . $id );
?>

<?php /* Start the Loop */ ?>
<div id="blog-entry">

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php
$format = get_post_format();

if ( false === $format ) {
get_template_part( 'content', 'standard' );
} else {
get_template_part( 'content', get_post_format() );
}
?>
<?php endwhile; ?>
<?php endif; ?>
</div> <!-- .blog-entry -->
<div class="clear"></div>
</div> <!-- .span12 -->

<?php if( ($home_columns == '2 Columns + Sidebar') or ($home_columns == '3 Columns + Sidebar') or ($home_columns == '1 Column + Sidebar') ) : ?>
<!-- START SIDEBAR -->
<?php if ( is_active_sidebar( 'ct_home_sidebar' ) ) : ?>
<?php if ( $home_sidebar == 'Right' ) : ?>
<div id="secondary" class="sidebar span4" role="complementary">
<?php else : ?>
<div id="secondary" class="sidebar span4 pull-left" role="complementary">
<?php endif; // $home_sidebar ?>
<?php dynamic_sidebar( 'ct_home_sidebar' ); ?>
</div> <!-- /span4 -->
<?php endif; ?>
<!-- END SIDEBAR -->
<?php endif; ?>
</div> <!-- /row-fluid -->
</div> <!-- /content -->

<?php
if ( $pagination_type != 'Infinite Scroll') { ?>
<div class="container clearfix">
<div class="container-pagination clearfix">
<div class="row-fluid">
<div class="span12">
<!-- Begin Navigation -->
<?php if (function_exists("ct_pagination")) {
ct_pagination();
} ?>
<!-- End Navigation -->
</div> <!-- /span12 -->
</div> <!-- /row-fluid -->
</div> <!-- /container-pagination -->
</div> <!-- /container -->
<?php } else { // if infinite scroll ?>
<!-- Begin Navigation -->
<?php if (function_exists("ct_pagination")) {
ct_pagination();
} ?>
<!-- End Navigation -->
<?php } ?>

<?php
// Restor original Query & Post Data
wp_reset_query();
wp_reset_postdata();
?>

<?php get_footer(); ?>

---------- Post agregado el 09-mar-2014 hora: 20:29 ----------

Enzo.. si queres te puedo habilitar el acceso al admin pa que la mires, igual esa la tengo en prueba ...
:witless:
 
[MENTION=81520]robertfenyiner[/MENTION] mmm pasa el código del archivo content-standard.php
 
<?php
/**
* The template for displaying posts in the Standard Post Format
*
* Learn more: Post Formats « WordPress Codex
*
* @package WordPress
* @subpackage Rule
* @since Rule 1.0
*/
?>

<?php
global $ct_options, $post, $ct_post_class;

$post_type = get_post_meta($post->ID, 'ct_mb_post_type', true);
if( $post_type == '' ) $post_type = 'standard_post';
?>


<?php if ($post_type == 'standard_post') : ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'masonry-box clearfix' ); ?> itemscope itemtype="http://schema.org/BlogPosting">
<?php else : // review ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'masonry-box clearfix' ); ?> itemscope itemtype="http://data-vocabulary.org/Review">
<?php endif; ?>

<?php


// Color for top line ( by default: #000000 )
$bg_color_top_line = get_post_meta( $post->ID, 'ct_mb_post_top_line_bg_color', true);

if ( empty( $bg_color_top_line ) ) $bg_color_top_line = $ct_options['ct_post_top_line_bg_color'];

// from post Metabox
$show_title = get_post_meta( $post->ID, 'ct_mb_show_post_title', true);
$show_content = get_post_meta( $post->ID, 'ct_mb_show_post_content', true);

if ( empty( $show_title ) ) $show_title = 1;
if ( empty( $show_content ) ) $show_content = 1;

//from Admin Panel
$show_date = $ct_options['ct_date_meta'];
$show_categories = $ct_options['ct_categories_meta'];
$show_author = $ct_options['ct_author_meta'];
$show_comments = $ct_options['ct_comments_meta'];
$show_views = $ct_options['ct_views_meta'];
$show_likes = $ct_options['ct_likes_meta'];

$excerpt_function = $ct_options['ct_excerpt_function'];
$excerpt_length = $ct_options['ct_excerpt_length'];
$mb_excerpt_length = get_post_meta( $post->ID, 'ct_mb_excerpt_length', true);
if ( empty( $mb_excerpt_length ) ) $mb_excerpt_length = '0';
?>

<div class="post-block <?php echo $ct_post_class; ?>">

<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-thumb">

<?php
if ( $ct_post_class == 'one_columns_sidebar' ) :
$thumb_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'single-post-thumb-crop');
else :
$not_crop = stripslashes( $ct_options['ct_blog_blocks_featured_type'] );

if ( $not_crop == 'original' )
$thumb_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'blog-thumb');
else
$thumb_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'single-post-thumb-crop');
endif;
?>
<a href="<?php echo the_permalink(); ?>"><img src="<?php echo $thumb_image_url[0]; ?>" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" /></a>
</div> <!-- .entry-thumb -->
<?php endif; ?>

<div class="entry-post-content">
<header class="entry-header">
<div class="entry-post-date" style="border-top-color: <?php echo $bg_color_top_line; ?>">
<?php if ( $show_date == 1 ) : ?>
<div class="date-month">
<?php echo esc_attr( get_the_date( 'M j, Y' ) ); ?>
</div>
<?php endif; ?>
</div>

<?php if ( $show_title == '1' ) : ?>
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'color-theme-framework' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2>
<?php endif; ?>
</header><!-- .entry-header -->

<?php if( $show_content == 1 ) : ?>
<div class="entry-content<?php if( $show_title == 0 ) echo ' margin-15t'; ?>" itemprop="articleBody">
<?php
if ( $excerpt_function == 'Content' ) :
the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'color-theme-framework' ) );
elseif ( $excerpt_function == 'Excerpt' ) :
if ( $mb_excerpt_length != '0' ) {
ct_excerpt_max_charlength( $mb_excerpt_length );
} else {
ct_excerpt_max_charlength( $excerpt_length );
}
?>
<?php endif; ?>
</div> <!-- /entry-content -->
<?php endif; ?>

<?php if ( ( $show_categories == 1 ) or ( $show_author == 1 ) ) : ?>
<div class="entry-meta clearfix<?php if( $show_title == 0 ) echo ' margin-15t'; ?>">
<?php if ( $show_categories == 1 ) : ?>
<?php _e( 'in ' , 'color-theme-framework' ); ?>
<?php echo get_the_category_list(', '); ?>
<?php endif; ?>

<?php
if ( ( $show_categories == 1 ) && ( $show_author == 1 ) ) _e( ' &mdash; by ' , 'color-theme-framework' );
if ( ( $show_categories == 0 ) && ( $show_author == 1 ) ) _e( 'by ' , 'color-theme-framework' ); else
if ( ( $show_categories == 1 ) && ( $show_author == 0 ) ) _e( '' , 'color-theme-framework' );

if ( $show_author == 1 ) echo the_author_posts_link();
?>
</div> <!-- /entry-meta -->
<?php endif; ?>

<div class="clear"></div>

<?php
// Displays a link to edit the current post, if a user is logged in and allowed to edit the post
edit_post_link( __( 'Edit', 'color-theme-framework' ), '<span class="edit-link"><i class="icon-pencil"></i>', '</span>' );
?>

<?php
$post_type = get_post_meta( $post->ID, 'ct_mb_post_type', true);
if ( empty( $post_type ) ) $post_type = 'standard_post';

if( ( $show_comments == 1 ) or ( $show_views == 1 ) or ( $show_likes == 1 ) or ( $post_type != 'standard_post' ) ) {
echo '<div class="divider-1px-meta"></div>';
}
?>

<footer class="entry-extra clearfix">
<?php ct_get_post_meta( $post->ID, $show_comments, $show_views, $show_likes ); ?>
</footer><!-- .entry-meta -->
</div> <!-- /entry-post-content -->

</div> <!-- /post-block -->
</article><!-- #post-ID -->
 
intenta eliminando
Insertar CODE, HTML o PHP:
<?php if( $show_content == 1 ) : ?>
<div class="entry-content<?php if( $show_title == 0 ) echo ' margin-15t'; ?>" itemprop="articleBody">
<?php
if ( $excerpt_function == 'Content' ) : 
the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'color-theme-framework' ) ); 
elseif ( $excerpt_function == 'Excerpt' ) : 
if ( $mb_excerpt_length != '0' ) { 
ct_excerpt_max_charlength( $mb_excerpt_length ); 
} else {
ct_excerpt_max_charlength( $excerpt_length ); 
}
?>
si no funciona dame admin por MP y reviso la plantilla

*las plantillas premiums son complicadas 😛
 
Enzo mi hermano.... no te imaginas como te agradezco la ayuda..... ya lo logre ... los pasos que hice fueron ..

Editar el archivo style.css, buscando las siguientes lineas.

#blog-entry .entry-content {margin-bottom: 15px;} Le puse por valor 0
.entry-extra {padding: 10px 0px;line-height: 11px;} Le puse por valor 0

eso me eliminaba el exceso de espacio despues de los ...
y agregando // al inicio de las siguientes lineas en el archivo content-image.php, logro eliminar el exceso de espacio incluido los ...

the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'color-theme-framework' ) );
ct_excerpt_max_charlength( $mb_excerpt_length );
ct_excerpt_max_charlength( $excerpt_length );

Muchas gracias hermano... posteo los pasos 1 x uno por si algun dia alguien los necesita ... Gracias Enzo
 
Última edición:
Atrás
Arriba