Commit 201ca9d2 authored by numeroteca's avatar numeroteca

issue #11 no muestra 'no items' si feed no funciona

parent 85448ead
......@@ -94,7 +94,7 @@ $logo2 = get_post_meta( $post_id, 'logo', true ); // gets all the info about the
<?php } ?>
<dt><?php echo __('Profile','colormag-child'); ?></dt>
<dd><?php
if ($logo2) { // if has logo image
if ($logo2) { // if has logo image
echo '<img class="size-thumbnail alignleft" src="' .$logo2["guid"]. '" width="150" />';
}
the_content();
......@@ -183,9 +183,6 @@ $logo2 = get_post_meta( $post_id, 'logo', true ); // gets all the info about the
if ($web_user_id) { // Do not display if no user is provided
?>
<h2 style="clear:both;">Posts de <?php echo $tit; ?> en Wikitoki.org:</h2>
<ul>
<!-- The Loop of posts by author -->
<?php
$args = array(
......@@ -198,29 +195,39 @@ $logo2 = get_post_meta( $post_id, 'logo', true ); // gets all the info about the
$my_query = new WP_Query($args);
$wp_count = $my_query->post_count;
if ($wp_count > 0 ) { // if there are no posts
if ($my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
<?php the_title(); ?></a>,
<?php the_time('d M Y'); ?>. <?php the_category('|');?>
</li>
<?php endwhile; else: ?>
<p><?php _e('No posts by this author.'); ?></p>
<?php endif; ?>
<!-- End Loop -->
</ul>
echo '<h2 style="clear:both;">Posts de '. $tit . ' en Wikitoki.org:</h2>';
<?php } ?>
echo "<ul>";
if ($my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
<?php the_title(); ?></a>,
<?php the_time('d M Y'); ?>. <?php the_category('|');?>
</li>
<?php endwhile; else: ?>
<p><?php _e('No posts by this author.'); ?></p>
<?php endif; ?>
<!-- End Loop -->
<?php
echo "</ul>";
}
} ?>
<?php
if ($feed) { // do not display if no feed is provided
?>
<h2><?php
//Lists posts in feed from users website
_e( 'Posts de', 'wikitoki' ); ?> <?php echo $tit; ?> <?php _e( 'en su blog', 'wikitoki' ); ?>.</h2>
<?php // Get RSS Feed(s)
// code from http://www.wpbeginner.com/wp-tutorials/how-to-display-any-rss-feed-on-your-wordpress-blog/
include_once( ABSPATH . WPINC . '/feed.php' );
......@@ -237,11 +244,25 @@ $logo2 = get_post_meta( $post_id, 'logo', true ); // gets all the info about the
$rss_items = $rss->get_items( 0, $maxitems );
endif;
?>
if ( $maxitems == 0 ) {
// if there are no items
} else { ?>
<h2>
<?php
//Lists posts in feed from users website
_e( 'Posts de', 'wikitoki' ); ?> <?php echo $tit; ?> <?php _e( 'en su blog', 'wikitoki' );
?>
</h2>
<?php } ?>
<ul>
<?php if ( $maxitems == 0 ) : ?>
<li><?php _e( 'No items', 'my-text-domain' ); ?></li>
<?php else : ?>
<?php // Loop through each feed item and display each item as a hyperlink. ?>
<?php foreach ( $rss_items as $item ) : ?>
......
......@@ -71,6 +71,7 @@ $post_id = $post->ID;
echo get_the_term_list( $post_id, 'tipo-actividad', ' ', ', ', '' ) . "<br>";
echo '<i class="fa fa-calendar-o"></i>'.get_post_meta( $post_id, '_act_date-init', true );
// Display more link if this is a Entidad CPT
} else if ( 'entidad' == get_post_type( $post_id ) ) {
?>
<a class="more-link" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><span><?php _e( 'Read more', 'colormag' ); ?></span></a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment