Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #652089

    Hey there,

    I want to load some pages as modals, while keeping them editable through the admin control panel.
    I have enqueued Foundation’s modal, and used the following code:

    
      <div class="reveal large" id="exampleModal2" data-reveal>
        <button class="close-button" data-close aria-label="Close modal" type="button">
          <span aria-hidden="true">&times;</span>
        </button>
    <?php
    
    $post_id = 249;
    echo get_post_field( 'post_content', $post_id );
    ?>
    
     </div>
    

    The code above outputs the content of the requited page in the right place, inside the modal,but the shortcodes are not parsed and appear as plain text.

    when I replace the echo line with the following line:

    
    echo do_shortcode(get_post_field( 'post_content', $post_id ));
    

    The content is outputted correctly, but outside of the modal – after the footer.

    All I want is to be able to produce content with the built-in visual editor that will be displayed as a modal if a user clicks various buttons.

    Help will be deeply appreciated,

    • This topic was modified 9 years, 1 month ago by binarylabels.
    #652400

    Hi binarylabels!

    Really nice work and cleaning on explaining.
    Can we please also chechk the page? Most probably it is because there is no loop there, but would be nice if we can review it also

    Cheers!
    Basilis

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.