Quantcast
Channel: Integrating LiveJournal feed into WP sidebar | WordPress.org
Viewing all articles
Browse latest Browse all 6

Reply To: Integrating LiveJournal feed into WP sidebar

$
0
0

Hello,

You can do it either via a widget (easier) or via a standard code, that looks like this:

<li id="updateRSS"><h2><a href="http://update.focused.ru">Обновления</a> (<a href="http://update.focused.ru/feed">RSS</a>)</h2>
			<?php include_once(ABSPATH . WPINC . '/feed.php'); $rss = fetch_feed('http://update.focused.ru/feed/'); $maxitems = $rss->get_item_quantity(5); $rss_items = $rss->get_items(0, $maxitems); ?>
			<ul>
			    <?php if ($maxitems == 0) echo '<li>No items.</li>';
			        else
			        foreach ( $rss_items as $item ) : ?>
			            <li>
			                     <a href='<?php echo $item->get_permalink(); ?>' title='<?php echo 'Запись от '.$item->get_date('d.m.Y, H:i'); ?>'>
                                             <?php echo $item->get_title(); ?></a>
                                    </li>
                                <?php endforeach; ?>
                        </ul>
			</li>

Sorry for cyrillic above, this is from my page. I took that code long ago from somewhere here that I was advised, it was before 3.0 and created bugs, when using several blocks of it. Anyway, this is clear to use, example here in the right sidebar.


Viewing all articles
Browse latest Browse all 6

Trending Articles