Setting the correct layout for wishlist archives and single wishlists in your theme

Wishlists are created with a custom post type called nm_gift_registry. As a result of this the plugin uses custom templates to display the archives as well as the single wishlists from this post type. Because of this, some themes may not layout the plugin templates correctly on the frontend. For example, below is an image of how the single wishlist page looks by default in the Astra theme:

And below is how it is supposed to look:

If your theme is one of those themes that don’t layout the templates correctly the solution is simple. You can either override the plugin’s templates or use shortcodes to output them in custom pages.

Overriding templates

To override the templates simply create an archive-nm_gift_registry file (for overriding the archive template) or a single-nm_gift_registry file (for overriding the single wishlist template) and put the file in the root folder of your theme. You can instead create a custom folder called nm-gift-registry in the root folder of your theme and put the file in this folder. Make sure, of course, that the file has the right markup and code.
After this, when viewing a wishlist archive or a single wishlist, instead of loading the plugin’s template, the plugin would automatically load the overriding files.

For more information on overriding the plugin’s templates see this article.

Using Shorcodes

An alternative way of fixing the layout issue which is also more designer friendly and quicker is to use shortcodes. Simply create a page in the WordPress admin area and put the [nmgr_archive] or [nmgr_wishlist] shortcode in the page, depending on which template you want to override. Then go to the plugin settings and register the page with the shortcode using the settings page for viewing single wishlists or page for viewing wishlist archives (as shown below).

After this, when viewing a wishlist archive or a single wishlist, instead of loading the plugin’s template, the plugin would automatically load the registered page(s) and display the archive or single wishlist content from the shortcodes.