Answer the question
In order to leave comments, you need to log in
How to display a post in a modal window?
Good afternoon! It is necessary to display the content of the post and comments to it in a modal window, I searched for plugins for this - I did not find anything. Are there any ready-made or at least semi-finished solutions to this problem? I remember on Drupal 7 there was an extension with similar functionality, did wordpress with a larger community really not guess to do this?
Answer the question
In order to leave comments, you need to log in
by clicking on the button that brings up the window, make an ajax request and put the information in the modal window
I won’t tell you about ready-made solutions, but if this is a single post for the entire site (for example, delivery conditions), then display the post in the basement inside the modal. If this is such a way of viewing - a modal with ajax-loading of the post.
WordPress has it 100%. It's just part of the theme.
On the example of bootstrap, in the list of posts by clicking on the title, not a page opens, but a modal window, where a post with comments is taken out by ID. This is a bad option, because all this will initially lie in the source of the page. Even what the user does not need.
Ajax would be a good option. When the modal opens, send an ajax request and put everything in the div's id in the modal's content.
Your task is actually very easy. It only takes an hour to learn ajax and the structure of a WP theme.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question