Respuestas de foro creadas

Viendo 9 respuestas - de la 16 a la 24 (de un total de 24)
  • Iniciador del debate brayancardiet

    (@brayancardiet)

    si alli esta la solucion entonces investigare mas sobre eso, la persona que programo el theme ya no es contactable para la empresa.

    Iniciador del debate brayancardiet

    (@brayancardiet)

    y como hago para actualizar ese valor, tengo que llamar a la funcion the_excerpt() con algun parametro? como actualizo el $post

    Iniciador del debate brayancardiet

    (@brayancardiet)

    <section id="news_last" class="row">
    	<div id="news_content" class="col-xs-6">
    	<?php 
            $args = 
            	array(
            		'post_type' => 'post', 
            		'numberposts' => 4, 
            		'orderby' => 'date', 
            		'order' => 'DESC',
            		'post_status' => 'publish',
            		'category__not_in' => array( 7 ),
            	);
            $posts = get_posts( $args );
            foreach ($posts as $post):
        ?>
    		<div class="row item">
    			<div class="col-xs-12">
    				<a href="<?php echo get_permalink($post->ID); ?>">
    					<h4><?php echo get_the_title($post->ID); ?></h4>
    				</a>
    				<div class="row info">
    					<div class="col-xs-12 head">
    						<?php 
    							$post_categories = wp_get_post_categories( $post->ID );
    							foreach($post_categories as $c):
    								$cat = get_category( $c );
    								$color = get_field('categoria_color', $cat);
    						?>
    								<a class="category-link pull-left" href="<?php echo get_category_link( $cat->term_id ); ?>">
    									<span class="etiqueta" style="background: <?php echo $color; ?>"><?php echo $cat->name; ?></span>
    								</a>
    						<?php 
    								break;
    							endforeach; 
    						?>
    
    						<?php 
    							$post_date = get_the_date( 'Y-m-d H:i:s', $post->ID );
    							$hace = new haceTanto($post_date,'h');
    						?>
    						<span class="time pull-left"><i class="fa fa-clock-o"></i> hace <?php echo $hace; ?></span>
    						<span class="share pull-left">
    							<ul class="nav nav-pills"> 
            						<li role="presentation"><a target="_blank" data-href="<?php echo get_permalink($post->ID); ?>" href="https://www.facebook.com/sharer/sharer.php?u=www.revistapolicial.pe/<?php echo get_permalink($post->ID); ?>"><i class="fa fa-facebook"></i></a></li>
    								<li role="presentation"><a target="_blank" href="https://twitter.com/intent/tweet?text=<?php echo get_the_title($post->ID); ?>&url=<?php echo get_permalink($post->ID); ?>"><i class="fa fa-twitter"></i></a></li>
            					</ul>
            					<div class="clearfix"></div>
    						</span>
    					</div>
    				</div>
    				<div class="info_news row">
    					<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
    						<?php if (has_post_thumbnail()): ?>
    							<img src="<?php the_post_thumbnail_url( $post->ID, 'medium' ); ?>" class="img-responsive" alt="<?php echo get_the_title($post->ID); ?>">
    						<?php else: ?>
    							<img src="<?php echo get_template_directory_uri(); ?>/assets/image/post-especial.png" class="img-responsive" alt="<?php echo get_the_title($post->ID); ?>">
    						<?php endif ?>
    					</div>
    				<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
    					
    					<p>
    					 <?php the_excerpt_max_charlength(160); ?>
    					</p>
    
    			</div>
    				</div>
    				<hr>
    			</div>
    		</div>
    	
    		<?php endforeach; ?>
    
    	</div>
    
    	<div id="news_ultimas" class="col-xs-3 news_ult">
    		<div class="col-xs-12 news">
                <div class="content">
                    <div class="header">
                        <h4>Últimas Noticias</h4>
                    </div>
    
    	            <?php 
    			        $args = 
    			        	array(
    			        		'post_type' => 'post', 
    			        		'numberposts' => 4, 
    			        		'orderby' => 'date', 
    			        		'order' => 'DESC',
    			        		'post_status' => 'publish',
    			        		'tax_query' => array(
    								array(
    									'taxonomy' => 'news',
    									'field' => 'slug',
    									'terms' => 'ultimas-noticias'
    								)
    							),
    			        	);
    			        $posts = get_posts( $args );
    			        foreach ($posts as $post):
    			    ?>
    					<div class="info-item">
    						<a class="title" href="<?php echo get_permalink($post->ID); ?>">
    							<?php echo get_the_title($post->ID); ?>
    						</a>
    
    						<div class="meta">
    								
    								<?php 
    									$post_categories = wp_get_post_categories( $post->ID );
    									foreach($post_categories as $c):
    									    $cat = get_category( $c );
    									    $color = get_field('categoria_color', $cat);
    								?>
    									<a class="etiqueta pull-left" href="<?php echo get_category_link( $cat->term_id ); ?>" style="color: <?= $color?>">
    										<?php echo $cat->name; ?>
    									</a>
    								<?php 
    										break;
    									endforeach; 
    								?>
    
    								<?php 
    								 	$post_date = get_the_date( 'Y-m-d H:i:s', $post->ID );
    									$hace = new haceTanto($post_date,'h');
    									//$fecha2 = new DateTime($post_date);
    									//$hace = hace($fecha2);
    								?>
    
    								<center>
    									<span class="time"><i class="fa fa-clock-o"></i> hace <?php echo $hace; ?></span>
    								</center>
    								
    								<span class="share pull-right">
    									<ul class="nav nav-pills"> 
    										<li role="presentation"><a target="_blank" data-href="<?php echo get_permalink($post->ID); ?>" href="https://www.facebook.com/sharer/sharer.php?u=www.revistapolicial.pe/<?php echo get_permalink($post->ID); ?>"><i class="fa fa-facebook"></i></a></li>
    										<li role="presentation"><a target="_blank" href="https://twitter.com/intent/tweet?text=<?php echo get_the_title($post->ID); ?>&url=<?php echo get_permalink($post->ID); ?>"><i class="fa fa-twitter"></i></a></li>
    									</ul>
    									<div class="clearfix"></div>
    								</span>
    										
    						</div>
    						<div class="img">
    							<a href="<?php echo get_permalink($post->ID); ?>">
    				     			<?php if (has_post_thumbnail()): ?>
    									<img src="<?php the_post_thumbnail_url( $post->ID, 'post-verde' ); ?>" class="img-responsive" alt="<?php echo get_the_title($post->ID); ?>">
    				     			<?php else: ?>
    									<img src="<?php echo get_template_directory_uri(); ?>/assets/image/post-verde.png" class="img-responsive" alt="<?php echo get_the_title($post->ID); ?>">
    				     			<?php endif ?>
    				     		</a>
    						</div>
    						<hr>
    					</div>
    				<?php endforeach; ?> 
            	</div>
    
            </div>
            
    	</div>
    
    	<div id="home-aside" class="col-xs-3 meta publicidad">
    
    		<?php
        if (is_page( 'prevencion' )) {
    		if ( is_active_sidebar( 'widget-aside-page-prevencion' ) ){
            	dynamic_sidebar( 'widget-aside-page-prevencion' );
    		}
    	}elseif (is_page( 'orientacion' )) {
    		if ( is_active_sidebar( 'widget-aside-page-prevencion' ) ){
            	dynamic_sidebar( 'widget-aside-page-prevencion' );
    		}
    	}else{
    		if ( is_active_sidebar( 'widget-aside-page-prevencion' ) ){
            	dynamic_sidebar( 'widget-aside-page-prevencion' );
    		}
       	}
    	?>
    	</div>
    	
    
    </section>
    
    • Esta respuesta fue modificada hace 5 años, 10 meses por brayancardiet.
    Iniciador del debate brayancardiet

    (@brayancardiet)

    este es la parte exacta, fragmento del anterior

    <div class=»info_news row»>
    <div class=»col-xs-12 col-sm-12 col-md-6 col-lg-6″>
    <?php if (has_post_thumbnail()): ?>
    ID, ‘medium’ ); ?>» class=»img-responsive» alt=»<?php echo get_the_title($post->ID); ?>»>
    <?php else: ?>
    /assets/image/post-especial.png» class=»img-responsive» alt=»<?php echo get_the_title($post->ID); ?>»>
    <?php endif ?>
    </div>
    <div class=»col-xs-12 col-sm-12 col-md-6 col-lg-6″>

    <p>
    <?php the_excerpt_max_charlength(160); ?>
    </p>

    </div>
    </div>

    Iniciador del debate brayancardiet

    (@brayancardiet)

    ese es el codigo completo del modulo

    Iniciador del debate brayancardiet

    (@brayancardiet)

    <section id=»news_last» class=»row»>
    <div id=»news_content» class=»col-xs-6″>
    <?php
    $args =
    array(
    ‘post_type’ => ‘post’,
    ‘numberposts’ => 4,
    ‘orderby’ => ‘date’,
    ‘order’ => ‘DESC’,
    ‘post_status’ => ‘publish’,
    ‘category__not_in’ => array( 7 ),
    );
    $posts = get_posts( $args );
    foreach ($posts as $post):
    ?>
    <div class=»row item»>
    <div class=»col-xs-12″>
    ID); ?>»>
    <h4><?php echo get_the_title($post->ID); ?></h4>

    <div class=»row info»>
    <div class=»col-xs-12 head»>
    <?php
    $post_categories = wp_get_post_categories( $post->ID );
    foreach($post_categories as $c):
    $cat = get_category( $c );
    $color = get_field(‘categoria_color’, $cat);
    ?>
    term_id ); ?>»>
    <span class=»etiqueta» style=»background: <?php echo $color; ?>»><?php echo $cat->name; ?></span>

    <?php
    break;
    endforeach;
    ?>

    <?php
    $post_date = get_the_date( ‘Y-m-d H:i:s’, $post->ID );
    $hace = new haceTanto($post_date,’h’);
    ?>
    <span class=»time pull-left»><i class=»fa fa-clock-o»></i> hace <?php echo $hace; ?></span>
    <span class=»share pull-left»>
    <ul class=»nav nav-pills»>
    <li role=»presentation»>ID); ?>» href=»https://www.facebook.com/sharer/sharer.php?u=www.revistapolicial.pe/<?php echo get_permalink($post->ID); ?>»><i class=»fa fa-facebook»></i>
    <li role=»presentation»>ID); ?>&url=<?php echo get_permalink($post->ID); ?>»><i class=»fa fa-twitter»></i>

    <div class=»clearfix»></div>
    </span>
    </div>
    </div>
    <div class=»info_news row»>
    <div class=»col-xs-12 col-sm-12 col-md-6 col-lg-6″>
    <?php if (has_post_thumbnail()): ?>
    ID, ‘medium’ ); ?>» class=»img-responsive» alt=»<?php echo get_the_title($post->ID); ?>»>
    <?php else: ?>
    /assets/image/post-especial.png» class=»img-responsive» alt=»<?php echo get_the_title($post->ID); ?>»>
    <?php endif ?>
    </div>
    <div class=»col-xs-12 col-sm-12 col-md-6 col-lg-6″>

    <p>
    <?php the_excerpt_max_charlength(160); ?>
    </p>

    </div>
    </div>
    <hr>
    </div>
    </div>

    <?php endforeach; ?>

    </div>

    <div id=»news_ultimas» class=»col-xs-3 news_ult»>
    <div class=»col-xs-12 news»>
    <div class=»content»>
    <div class=»header»>
    <h4>Últimas Noticias</h4>
    </div>

    <?php
    $args =
    array(
    ‘post_type’ => ‘post’,
    ‘numberposts’ => 4,
    ‘orderby’ => ‘date’,
    ‘order’ => ‘DESC’,
    ‘post_status’ => ‘publish’,
    ‘tax_query’ => array(
    array(
    ‘taxonomy’ => ‘news’,
    ‘field’ => ‘slug’,
    ‘terms’ => ‘ultimas-noticias’
    )
    ),
    );
    $posts = get_posts( $args );
    foreach ($posts as $post):
    ?>
    <div class=»info-item»>
    ID); ?>»>
    <?php echo get_the_title($post->ID); ?>

    <div class=»meta»>

    <?php
    $post_categories = wp_get_post_categories( $post->ID );
    foreach($post_categories as $c):
    $cat = get_category( $c );
    $color = get_field(‘categoria_color’, $cat);
    ?>
    term_id ); ?>» style=»color: <?= $color?>»>
    <?php echo $cat->name; ?>

    <?php
    break;
    endforeach;
    ?>

    <?php
    $post_date = get_the_date( ‘Y-m-d H:i:s’, $post->ID );
    $hace = new haceTanto($post_date,’h’);
    //$fecha2 = new DateTime($post_date);
    //$hace = hace($fecha2);
    ?>

    <center>
    <span class=»time»><i class=»fa fa-clock-o»></i> hace <?php echo $hace; ?></span>
    </center>

    <span class=»share pull-right»>
    <ul class=»nav nav-pills»>
    <li role=»presentation»>ID); ?>» href=»https://www.facebook.com/sharer/sharer.php?u=www.revistapolicial.pe/<?php echo get_permalink($post->ID); ?>»><i class=»fa fa-facebook»></i>
    <li role=»presentation»>ID); ?>&url=<?php echo get_permalink($post->ID); ?>»><i class=»fa fa-twitter»></i>

    <div class=»clearfix»></div>
    </span>

    </div>
    <div class=»img»>
    ID); ?>»>
    <?php if (has_post_thumbnail()): ?>
    ID, ‘post-verde’ ); ?>» class=»img-responsive» alt=»<?php echo get_the_title($post->ID); ?>»>
    <?php else: ?>
    /assets/image/post-verde.png» class=»img-responsive» alt=»<?php echo get_the_title($post->ID); ?>»>
    <?php endif ?>

    </div>
    <hr>
    </div>
    <?php endforeach; ?>
    </div>

    </div>

    </div>

    <div id=»home-aside» class=»col-xs-3 meta publicidad»>

    <?php
    if (is_page( ‘prevencion’ )) {
    if ( is_active_sidebar( ‘widget-aside-page-prevencion’ ) ){
    dynamic_sidebar( ‘widget-aside-page-prevencion’ );
    }
    }elseif (is_page( ‘orientacion’ )) {
    if ( is_active_sidebar( ‘widget-aside-page-prevencion’ ) ){
    dynamic_sidebar( ‘widget-aside-page-prevencion’ );
    }
    }else{
    if ( is_active_sidebar( ‘widget-aside-page-prevencion’ ) ){
    dynamic_sidebar( ‘widget-aside-page-prevencion’ );
    }
    }
    ?>
    </div>

    </section>

    Iniciador del debate brayancardiet

    (@brayancardiet)

    supongo que es en algun punto hay que configurar que excerpt muestre el contenido de cada una de las entradas, pero en este caso esta mostrando solo el contenido de la ultima que se subio a la web

    Iniciador del debate brayancardiet

    (@brayancardiet)

    el texto es el contenido de la ultima entrada, siempre va a mostrar el contenido de la ultima entrada cuando en realidad deberia mostrar el contenido de cada una de las entradas correspondientes

    Iniciador del debate brayancardiet

    (@brayancardiet)

    claro, es que tenia desactivado la funcion the_excerpt(), ahora ya la active y pueden ver si entran que el texto del excerpt muestra en todas las entradas lo mismo
    y anteriormente no estaba asi, mostraba la descripcion de cada una de las entradas

    • Esta respuesta fue modificada hace 5 años, 10 meses por brayancardiet.
Viendo 9 respuestas - de la 16 a la 24 (de un total de 24)