wordpress content .php file in an iframe's src in a wordpress post
I would like to insert an iframe with WordPress content inside a post. I explain myself. I have two things: a post and a presentation. In the the_content()
WordPress filter, I add my iframe to the $content. This iframe has a src pointing to a custom .php file, and inside this .php I want to have access to my loop but I can not manage to do it.
So I cheat and pass the ID of the post through the URL so my iframe code is :
iframe src=\"".WP_PLUGIN_URL."/presentation/embedded_presentation_iframe.php?postid=". get_the_ID() ."\" id=\"embedded-frame-presentation\"
And inside my .php I use this :
$postid = $_GET["postid"];
...
echo do_shortcode( get_post_meta($postid, 'awp_slides', true) );
The issue now is that I have some plugins adding some possible shortcodes and my shortcodes are transformed into plugins syntaxes, but since my .php file is outside the wordpress loop, the transformed shortcodes are not applied in my iframe...
So I think I have two ways for solving that but I don't know how to do both :
- I try to put my .php file (which is the src of iframe) into the loop of wordpress, I don't know how so my $content is process and the plugins are applied to my iframe
- Or maybe a function exist in wordpress which would be my $content but already processed so instead of using
do_shortcode( get_post_meta($postid, 'awp_slides', true) );
I could use something likeapply_plugins(do_shortcode( get_post_meta($postid, 'awp_slides', true) ));
Topic custom-content posts plugins Wordpress
Category Web