Magento 2: How to sort order of custom links nav?
A little bit code modification is need in your code.
Open your di.xml
then put sortOrder="-1"
Using this sortOrder="[NumericValue]"
tag you can arrange sequesce of execution of plugin for the same method.
plugin sortOrder: The order in which plugins that call the same method are run. see http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html
Reason:
Magento adds categories in the menu using a plugin of same class at Magento_Catalog.
<type name="Magento\Theme\Block\Html\Topmenu">
<plugin name="catalogTopmenu" type="Magento\Catalog\Plugin\Block\Topmenu" />
</type>
So should run your plugin before that default plugin catalogTopmenu
,
we know that sequence of plugins can manage from sortOrder field,
That you need put sortOrder of your plugin in negative than catalogTopmenu
.
Also if you don't put sort order in plugin then it means sortOrer value should be 0
.
That reason, I'm suggesting to put sortOrder value -1.