How add sitemap in smartblog with gsitemap PrestaShop

Hello. How add sitemap in smartblog, if you use gsitemap in PrestaShop?

Adding a site map for your online store will increase search traffic and SEO

Change gsitemap to build a sitemap for blog

In order for gsitemap to start adding entries to the sitemap from our blog, we need to configure it.

In 49 line, we can add property ‘post’

This allows us to use our posts in building a sitemap

Next, we need to prioritize our pages to be displayed in our Prestashop

In 76 line, function install, after ‘GSITEMAP_PRIORITY_CMS’ => 0.5.

Then, after line 654, which is when the function that adds the CMS pages ends, I add the following function which is a copy of the one used to get the CMS links but I modify it to get the blog’s. I do it without using blog objects or the link object as in other methods since I found it easy to get them with an sql query (although it is not the most elegant way I repeat, besides to get the home I have to repeat code). Also, in the value of type and page I put ‘blog’, you can put what you want. The function in particular:
(THE SQL TO FORM THE URL IN MY SMART BLOG IS idpost_campolinkrewrite.html IF IT IS NOT SO IN YOUR BLOG YOU HAVE TO MODIFY THE SQL AND IN THE VARIABLE blogfolder YOU MUST PUT YOUR BLOG FOLDER)

Finally in the function _getPriorityPage method (protected function _getPriorityPage($page)),  I add these two lines before the return:

All of this function:

 

 

 

Комментарий “How add sitemap in smartblog with gsitemap PrestaShop

  1. Здравствуйте, я копирайтер, пишу тематику вашего сайта, за 1000 символов без пробела 100 руб.
    Если Вам интересно, отпишитесь!

Добавить комментарий

Ваш e-mail не будет опубликован.