Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /****
- WordPress SimplePie. Display Categories from RSS Feed and give individual ones their own CSS classes - http://www.worldoweb.co.uk/2012/display-wordpress-posts-on-another-wp-blog
- Please note that Tags may also be displayed as categories within the RSS feed
- ****/
- <?php if ($maxitems == 0) echo '<div>No items.</div>'; else foreach ( $rss_items as $item ) : ?>
- <div class="midia">
- <div class="icone">
- <?php echo '<img src="' .get_first_image_url($item->get_content()). '"/>'; ?>
- <?php foreach ($item->get_categories() as $category)
- {
- if ($category->get_label() === 'Mobile'){
- echo '<div class="tipo"><i class="fa fa-video-camera"></i>'.$category->get_label().'</div>';
- }
- else if ($category->get_label() === 'Coding'){
- echo '<div class="tipo"><i class="fa fa-code"></i>'.$category->get_label().'</div>';
- }
- else if ($category->get_label() === 'Android'){
- echo '<div class="tipo"><i class="fa fa-android"></i>'.$category->get_label().'</div>';
- }
- else {
- echo '<div class="tipo"><i class="fa fa-heart"></i>'.$category->get_label().'</div>';
- }
- }?>
- </div>
- <div class="mid-tit"><a href='<?php echo esc_url( $item->get_permalink() ); ?>' title='<?php echo esc_html( $item->get_title() ); ?>'> <?php echo esc_html( $item->get_title() ); ?></a></div>
- </div>
- <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement