Forums

Integrating LiveJournal feed into WP sidebar (3 posts)

  1. Sublime Oblivion
    Member
    Posted 2 years ago #

    I would much appreciate it if someone could recommend me a plug-in which allows you to integrate a feed from another blog (in my case LiveJournal) into the sidebar of my main WordPress blog, i.e. so that it displays the latest 10 entries in the LJ account, for instance.

    Preferably through the Widgets menu rather than changing sidebar.php

    Thanks for any help.

  2. Sublime Oblivion
    Member
    Posted 2 years ago #

    *bump*

  3. UncleSam
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic