Reader Feed with image
-
i have 2 website and i add in that 2 site FEED READER RSS
in SITE 1 i add FEED READER from SITE 2
and
in SITE 2 i add FEED READER from SITE 1with same CODE:
<?php $rss = fetch_feed('feeeeeeed URL'); if (!is_wp_error( $rss ) ) : $maxitems = $rss->get_item_quantity(6); $rss_items = $rss->get_items(0, $maxitems); endif; ?> <?php function get_first_image_url($html) { if (preg_match('/<img.+?src="(.+?)"/', $html, $matches)) { return $matches[1]; } } ?> <?php if ($maxitems == 0) echo ''; else foreach ( $rss_items as $item ) : ?> <article> <div class="articol" > <h2><a target="_blank" href='<?php echo esc_url( $item->get_permalink() ); ?>' title='<?php echo esc_html( $item->get_title() ); ?>'> <?php echo esc_html( $item->get_title() ); ?></a></h2> <div class="art-img relative"> <a target="_blank" href='<?php echo esc_url( $item->get_permalink() ); ?>' title='<?php echo esc_html( $item->get_title() ); ?>'> <?php echo '<img src="' .get_first_image_url($item->get_content()). '"/>'; ?> </a> </div> </div> <?php endforeach; ?>
in site 1 appear IMAGE , in site 2 no appear image, why? can explain? or help me ?
- The topic ‘Reader Feed with image’ is closed to new replies.