This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Primer loop | |
<?php $sticky = get_option('sticky_posts'); rsort( $sticky ); $sticky = array_slice( $sticky, 0, 5); query_posts( array( 'post__in' => $sticky,'caller_get_posts' => 1 ) ); ?> | |
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> | |
//contenido | |
<?php endwhile; endif; wp_reset_query(); ?> | |
// Segundo loop | |
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $no_sticky_args = array('post__not_in' => get_option('sticky_posts'), 'paged' => $paged ); query_posts($no_sticky_args); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function excerpt($limit) { | |
$excerpt = explode(' ', get_the_excerpt(), $limit); | |
if (count($excerpt)>=$limit) { | |
array_pop($excerpt); | |
$excerpt = implode(" ",$excerpt).'...'; | |
} else { | |
$excerpt = implode(" ",$excerpt); | |
} | |
$excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); | |
return $excerpt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $nombre_variable = get_post_meta($post->ID, 'nombre_cf', true); if ($nombre_variable) { ?> | |
<?php the_field('nombre_cf'); ?> | |
<?php } else { ?> | |
//mostrar esto | |
<?php } ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( has_post_thumbnail() ) { | |
the_post_thumbnail('servicio', array('class' => 'nombre_clase')); | |
} else { ?> | |
<img src="http://placehold.it/475x266/" /> | |
<?php } ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Primer loop | |
<?php $sticky = get_option('sticky_posts'); rsort( $sticky ); $sticky = array_slice( $sticky, 0, 5); query_posts( array( 'post__in' => $sticky,'caller_get_posts' => 1 ) ); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> | |
//contenido | |
<?php endwhile; endif; wp_reset_query(); ?> | |
// Segundo loop | |
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $no_sticky_args = array('post__not_in' => get_option('sticky_posts'), 'paged' => $paged ); query_posts($no_sticky_args); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> | |
//contenido | |
<?php endwhile; endif; wp_reset_query(); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt).'...'; } else { $excerpt = implode(" ",$excerpt); } $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); return $excerpt; } function content($limit) { $content = explode(' ', get_the_content(), $limit); if (count($content)>=$limit) { array_pop($content); $content = implode(" ",$content).'...'; } else { $content = implode(" ",$content); } $content = preg_replace('/\[.+\]/','', $content); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); return $content; } | |
<?php echo excerpt(25); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// set up or arguments for our custom query | |
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; | |
$query_args = array( | |
'post_type' => 'post', | |
'category_name' => 'tutorials', | |
'posts_per_page' => 5, | |
'paged' => $paged | |
); | |
// create a new instance of WP_Query |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dirección repositorio: https://[email protected]/thetitan/sourcecodedna.git. |
OlderNewer