Magento filters url rewrite - php

I've got one task about Layer Navigation block on site, powered by Magento.
We want to make a SEO friendly URL's in filters:
Now there are links like
mymagazine.ru/category/subcategory1?manufacturer=1926
As you see - manufacturer=1926 is a GET-parameter, which just filter the products.
So I need to make this link like
mymagazine.ru/category/subcategory1/my_manufacturer
Where "my_manufacturer" is an allias to "?manufacturer=1926".
There is one way to do this task: we can make allias for all the filter pages manually with the Magento admin. But the site got a great catalloge, so this would be too tedious. I thought, that this extentions could help me, but not in my practice...
Yoast-landing-pages
Fishpigs_attribute_splash_page
If you have any thought about this problem, I would love to hear them.
Thank's for your attention!

What I did on my store is tag those links in the layered navigation with rel="noindex,nofollow" and I put the same into the robots meta tag in the target pages. I didn't want every variation of the pages to be indexed as I don't want duplicate content. Each variation of the category pages from that layered navigation ends up having the same title, meta description, and often many of the same products.

Related

Calling Template to offer same display as other pages

I am building a Woocommerce shop. As you will know, when adding products they are then assigned to categories... when I view each category, the products are displayed in a generic fashion... IE 12 products per page over XX Pages...
Currently, when creating a new page in wordpress, it does not allow me to select the template which woocommerce uses to display my categories.
I am trying to find a way to create my own template which calls the layout from the template all my other categories uses, so that I can then use it on any custom product pages I make whilst keeping the website uniform
currently when I use the featured products shortcode, It displayes how ever many products I ask it to, It does not break it doen into pages and I cann ot use the filters that I use on the other pages.
I have tried...
get_template()
and
template_loader()
Functions but nothing seems to work.
I am new to web design but seem to be picking up fast but cannot figure for the life of me how to call a template layout into my own page.
I am also unsure what template woocommerce uses to display its category items, I have searched google and seem to get conflicting answers.
any advice would be much appreciated

Add additional pages to wordpress yoast seo sitemap xml programatically

I have a stragne question, I have been gogoleing for a while, but have found no answer.
I have a Wordpress site where the Yoast Seo plugin has been installed, titles, descriptions have been added, I could also manage to change the title tag, canonical url generated by it with the wpseo- filters.
The sitemap xmls are also generated fine, but I would need to add additional pages to it.
We have a search page on the site, we search by a rental custom post type.
Rentals can be searched by location.
The search page is eg.: /rentals.
We have found, that there are several sites (I can show you one in hungarian, but I'm sure you will get it) where the search results are indexed by google.
Like this one:
https://www.trivago.hu/?iSemThemeId=8302&iPathId=36103&sem_keyword=hotel%20p%C3%A1rizs&sem_creativeid=187836310244&sem_matchtype=b&sem_network=g&sem_device=c&sem_placement=&sem_target=&sem_adposition=1t3&sem_param1=&sem_param2=&sem_campaignid=242651542&sem_adgroupid=15360737662&sem_targetid=kwd-4821159859&sem_location=1007624&cip=3612001012&gclid=CjwKEAjwoLfHBRD_jLW93remyAQSJABIygGpWkl9XD9HJ7G8ZC7NbJ93ygmeFVxpZcici062NnMlgRoCkNfw_wcB
You get to this page if you search hotels paris. If you have a look at this page, this is already a search result, search parameters are set.
Now we would like to do the same with the Wordpress site.
I have done a redirection for the urls:
/rentals/budapest
/rentals/hungary
... there are more locations.
so they go to the rentals page, where I set the search parameters, I have changed the canonical urls of these pages, but I would like to add these pages to the xml sitemap also.
The problem is that these page do not exist in the database.
Is there a filter that I coul use to add these pages to the sitemap.xml in Yoast Seo plugin?
Has anyone done a similar thing in wp?
Any help is appreciated, thank you!
I have found the answer!
There is a wpseo_do_sitemap_ filter, I had to use that one. Also, This filter only created a custom sitemap, I also needed the 'wpseo_sitemap_index' filter to add my custom sitemap xml to the sitemaps index page.
Detailed solution was found under this link!
https://gist.github.com/mohandere/4286103ce313d0cd6549

Wordpress Multiple Category Descriptions

How do you enable multiple category_description(); on wordpress category description pages? What I have been able to find out is that you can only have one on a category page. I may be wrong, that's why I'm here :)
The codex https://codex.wordpress.org/Function_Reference/category_description doesn't seem to say anything about enabling multiple category_descriptions for categories.
I would really love to have one description at the top (before the content), and one description below (after the content) in the front end. Trying to use this on a woocommerce product category page. Most hosted ecommerce platforms have this description above and below implemented. Of course, this will be useful for all post types as well. Any help appreciated!
You need to create an extra field hook. Have a look at this.

Widget or Plug-in? Building a theme and unsure how to approach optional content

I have a question regarding how best to build a widget/plug-in for WordPress.
I have tried to code this thing out but unfortunately to no avail but that's because I'm increasingly thinking I'm going about it the entirely wrong way.
This is what I'm trying to achieve:
I have built a theme from scratch. In this theme I have two content areas. The larger of the two contains the main content and the smaller of the two (proposed widget/plug-in) contains supplementary information (opening times, Facebook feed). I don't want this widget/plug-in to appear on every page and would like the ability to turn it on or off within the usual WordPress admin area.
The impression I am getting is that I can build the widget that contains the content I want (with necessary forms to change said content) but it is either on for ALL pages or off for ALL pages, no sort-of page specific functionality. That's where I'm thinking a plug-in would extend the functionality and allow me to be more page specific with it. That is my current set-up with a theme I'm running and plug-in I added (neither of which were coded by me) but I would like to repeat it as best as possible.
Would it be right to assume that widgets are not really designed to have page specific functionality and that function should be left down to a plug-in?
I appreciate this question asks nothing really in the way specific advice but I would just like an opinion or two on the best approach before I go away and create it - this is my main struggle at the moment.
Thanks for looking.
This can be done with the Jetpack plugin. Once activated you can choose what widgets display on what pages:
The Widget Visibility module enables you to configure widgets to appear only on certain pages (or be hidden on certain pages) by using the Visibility panel.
Visibility is controlled by five aspects: page type, category, tag, date, and author. For example, if you wanted the Archives widget to only appear on category archives and error pages, choose “Show” from the first dropdown and then add two rules: “Page is 404 Error Page” and “Category is All Category Pages.”
Originally posted here
It is also possible with the Display Widgets plugin.
This is a common problem. The usual remedy is to use an existing plugin that allows widgets to be tied to pages.
The 3 most popular plugins for this are:
JetPack
Per Page Widgets
Widget Logic

Magento - list specific cms page link in left hand block

I want to list specific CMS pages LINKS to lefthand side of block in magento.
eg. suppose i have added 10 cms pages in admin and now i want to list 2 to 3 specific cmspages which i want. How can i do it ?
There are many ways to do this task using Widgets -
Process 1: We can add Widgets for specific CMS page as "CMS Page Link".
Magento provides the facility to add many kind of Widgets.
Process 2: We can create a Static block where we can put the Code for Link of CMS pages.
And we can call this Static Block using Widget on Left/Right Column or the position where we want.
Hope it'll be Helpful :)
Thanks.

Categories