Create a page with the necessary content (restaurant menu in your example) with built-in WordPress tools or some kind of visual editor, for example, Visual Composer. Set the page visibility to "Personal" to avoid direct access to it.
Add this code to your theme's functions.php:
// Add shortcode to output html block from page containing template function html_block_shortcode( $atts ) { $p = get_page_by_title( $atts['title'] ); if ( empty( $p ) ) { return ''; } $id = apply_filters( 'wpml_object_id', $p->ID, 'post' ); $p = get_post( $id ); return do_shortcode( $p->post_content ); } add_shortcode('block', 'html_block_shortcode');
You have a shortcode to display any page by its title, for example:
[block title="My Popup"]
This shortcode will display the contents of the page with the heading "My Popup" (even if its visibility is "Personal").
In the code above there is a wpml_object_id filter - it will display the page with the translation when using the WPML plugin and will not do anything if it is missing. Feel free to leave in your code.
Install the Easy FancyBox plugin .
On the page where you need to place a link to the pop-up window, add in the admin to the bottom of the blank under the window:
<div class="fancybox-hidden" style="display: none;"> <div id="my_popup">[block title="My Popup"]</div> </div>
or if you have a page template in php, add to it
<div class="fancybox-hidden" style="display: none;"> <div id="my_popup"><?php echo do_shortcode('[block title="My Popup"]');?></div> </div>
In the place of the page where you need to make a pop-up call, insert a link of the following type:
<a class="fancybox-inline" href="#my_popup">Кликните для просмотра меню</a>
Please note that the link and the workpiece under the window are tied via id = "my_popup" and href = "# my_popup".
This way you will have a fully editable text (restaurant menu) in a pop-up window.