• Resolved mcnika

    (@mcnika)


    I have a problem with importing my custom widget.

    I have created a “Recent Posts” widget and have a field “Filter posts by Category”. When saving the widget values, it saves the category id. So when importing the demo content xml, all categories get different category IDs and the widget category id does not match the post category id.

    Is there any way to regulate such problems?

Viewing 1 replies (of 1 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    IDs will always change, when importing into a fresh WP installation (or, if you import into an old WP as well). You can’t guarantee, that the IDs will be the same… So, it’s always better, to use the category/tags slugs instead of IDs, for saving data.

    There might be another way… You could check, to which ID, the old IDs have changed during the import and then use these new IDs, to replace, when importing the widgets (with the appropriate plugin filter). If you are using these widgets in a page builder, then that’s a different story, but this should work for widgets importing into the sidebars (Appearance -> Widgets).

    Take care!

Viewing 1 replies (of 1 total)
  • The topic ‘Widget category id does not match post category id’ is closed to new replies.