Advertisements Объявления

If you maintain more than one blog or a forum, then you can display the RSS feed of your posts or articles from another website on your WordPress blog. Если вы поддерживаете больше одного блога или форума, то вы можете отобразить RSS-канал вашей должности или статьи с другого сайта на ваш блог WordPress. This would in turn give more exposure to your posts written else where. Это, в свою очередь, уделять больше воздействия на ваш сообщения, написанные другом где. Although there might be plugins to do this job, you can do this using just 2 lines of code. Хотя могут быть плагины чтобы сделать эту работу, вы можете сделать это, используя только 2 строки кода. WordPress has a build in function to get the RSS feed of any website. WordPress имеет построить в функцию, чтобы получить канал RSS из любого сайта.

We used this query to get the RSS feed of our Мы использовали этот запрос, чтобы получить канал RSS наших Mobile Blog Мобильный блог in the sidebar. на боковой панели. Here is the code. Вот код.

<?php include_once(ABSPATH . WPINC . '/rss.php'); <? PHP include_once (ABSPATH. WPINC. '/ rss.php');
wp_rss('http://feeds2.feedburner.com/themobileblogin, 5); ?> wp_rss ( 'http://feeds2.feedburner.com/themobileblogin, 5);?>

The first line of code is to call to RSS core file of WordPress and in the second line we specify the feed URL and the number of posts to be displayed using the wp_rss() function. Первая строка кода является вызовом RSS основного файла WordPress, а во второй строке мы указываем URL ленты и количества должностей, которые будут отображаться с помощью wp_rss () функцию. You need to replace the feed URL with the URL you want to display in the sidebar. Вам необходимо заменить Feed URL с URL, которая должна отображаться на боковой панели. You can see the Mobile Blog posts showing up in the sidebar of this blog using this method. Вы можете увидеть мобильный блог не отображаются на боковой панели этого блога с помощью этого метода.

Feed from another blog

You can also do some formatting using the <ul> and <li> based on your current theme style. Вы можете также сделать некоторые форматирования помощью <ul> и <li> основании текущего стиля теме.

NB: If you are not comfortable adding the code, you might get some plugins to do the job, but it is always advisable to go with lesser number of plugins. Н.Б.: Если вас не устраивает добавления кода, вы можете получить некоторые плагины, чтобы сделать работу, но это всегда целесообразно идти с меньшим числом плагинов.

Thanks to Благодаря WP Recipes РГ Рецепты for this tip. В этом совете.


5 Responses to “How to Display Any RSS Feed on Wordpress Blog” 5 Ответ к "как отобразить RSS-канал на Wordpress блог"

  1. Satbir Singh Satbir Сингх says: говорит:

    Also, if your theme supports widgets then you can directly add RSS widget to your blog sidebar Также, если ваша тема поддерживает виджеты, то вы можете сразу добавить RSS виджет для блога Sidebar

  2. Blogsdna Blogsdna says: говорит:

    Yes, Widget supported themes can directly add RSS Widget which intern usages above code and rss.php to retrieve feeds Да, поддержка виджетов темами могут непосредственно добавить RSS виджет, который Intern обычаи выше код и rss.php получить каналы

  3. [...] How to Display Any RSS Feed on Wordpress Blog [...] [...] Как отображать RSS-канал на Wordpress блог [...]

  4. Binny VA Binny В.А. says: говорит:

    Small error in the code. Небольшая ошибка в коде. Second line must be.. Вторая линия должна быть ..
    wp_rss('http://feeds2.feedburner.com/themobileblogin', 5); ?> wp_rss ( 'http://feeds2.feedburner.com/themobileblogin', 5);?>

    The ending ' is missing. Окончание 'отсутствует.

  5. Rob says: Роб говорит:

    What if you don't want the RSS to go to a sidebar, but the actual main body of your website? Что делать, если вы не хотите RSS пойти в боковой панели, однако фактически основная часть вашего сайта? I belong to an organisation that is globla and I'd like its news to appear in th emain body of my spin-off site, not just in a sidebar? Я принадлежу к организации, которая globla и я хотел бы свою новость появляется в теле-й emain моей побочные сайт, а не только на боковой панели?

Leave a Reply Написать ответ