S
S
Soho2015-04-07 14:39:51
Yandex
Soho, 2015-04-07 14:39:51

How to connect a site to the Yandex.Real Estate xml format?

The website of the real estate agency is made on wordpress, how to integrate with Yandex.Real Estate? Maybe there are ready-made solutions? or in what file is the tape generated?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Larionov, 2015-04-09
@focuspro

I just recently completed this task.
There is hardly a ready-made solution, because everyone has their own data structure for export. I did it myself.
In functions.php add write:

// Yandex.Realty RSS
add_action('init', 'AddYandexRSS');
function AddYandexRSS(){
  add_feed('yandex-realty', 'ProceedYandexRealtyRSS');
}
function ProceedYandexRealtyRSS() {
  get_template_part('rss-realty');
}

Written registers a new RSS feed in Wordpress, which will be located at site.com/feed/yandex-realty/
The content of the feed is taken from the rss-realty.php file in the theme folder.
In rss-realty.php we write the following:
header('Content-Type: '.feed_content_type('rss-http').'; charset='.get_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?>'; 
?>
<realty-feed xmlns="http://webmaster.yandex.ru/schemas/feed/realty/2010-06">
<generation-date><?= date('c'); ?></generation-date>

<!-- здесь проходим циклом по списку своих объектов недвижимости, оборачивая их в тег <offer internal-id="<? the_ID(); ?>"></offer>     -->

</realty-feed>

Which fields to add depends on the specific task and on the available data.
Documentation for the design of the rss-feed of Ya.Nedvizhimost - here: help.yandex.ru/webmaster/realty/requirements.xml

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question