Remove Header and Footer in iframe

You could detect the $_SERVER[‘HTTP_REFERER’] variable to detect whether the page is requested from an external server. If so, then you should load an alternative header and footer using get_header() and get_footer(). You’ll need those calls to make sure all scripts and stylesheets are loaded, but you can remove the other content that make up … Read more

Error with Custom Admin Screen in iframe Thickbox

Interesting question. Investigating it, I’ve found a [wp-hackers] thread by the same Dion Hulse which gives a bit more of information. First, a testing page with a simple link which will open another admin page in a thickbox. add_action(‘admin_menu’, ‘wpse_71437_admin_submenu’); function wpse_71437_admin_submenu() { add_menu_page( ‘TB’, ‘<span style=”color:#e57300;”>Thickbox</span>’, ‘edit_pages’, ‘open_hidden_page_in_thickbox’, ‘wpse_71437_submenu_page’, ”, // no icon 1 … Read more

Youtube – Embed as IFRAME

If you don’t want to utilize the latest oembed functions and want the old iframe way from any page or post, you can do these: Get the embed code from any youtube video. While editing/creating your post/page, select the Text(HTML) mode of the editor Simply paste the embed code As noted by PayteR, this will … Read more

Load post content into iframe

Not sure, but I think ajax solution would be more apropriate. But anyways, if I understand this corectly, you have an archive where full posts are loaded inside iframe. If this is a case you can modify template file (single.php) and remove header and footer take a look at Template Hierarchy for further reading I … Read more

how can i embed wordpress backend in iframe

By default WordPress sends an HTTP header to prevent iframe embedding on /wp_admin/ and /wp-login.php: X-Frame-Options: SAMEORIGIN That’s a security feature. If you want to remove this header remove the filters: remove_action( ‘login_init’, ‘send_frame_options_header’ ); remove_action( ‘admin_init’, ‘send_frame_options_header’ ); But you should really use the multisite feature as Tom J Nowell suggested.

How to add editor-style.css styling to wp_editor on front end for comments

Actually you can include the editor-style.css (or any other stylesheet), just pass a “content_css” value to tinymce that points to a css file: wp_editor( $content, ‘editablecontent’, array( ‘tinymce’ => array( ‘content_css’ => get_stylesheet_directory_uri() . ‘/editor-styles.css’ ) ); So the original posters code would look like: add_filter( ‘comment_form_defaults’, ‘custom_comment_form_defaults’ ); function custom_comment_form_defaults( $args ) { if … Read more

Add post class to the TinyMCE iframe?

The filter you’re after is tiny_mce_before_init. Using this, we can hook into TinyMCE’s ‘init_array’ and add body classes: add_filter( ‘tiny_mce_before_init’, ‘wpse_235194_tiny_mce_classes’ ); function wpse_235194_tiny_mce_classes( $init_array ){ global $post; if( is_a( $post, ‘WP_Post’ ) ){ $init_array[‘body_class’] .= ‘ ‘ . join( ‘ ‘, get_post_class( ”, $post->ID ) ); } return $init_array; } We’re joining the post … Read more

Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area

You could over-ride the CSS by using the admin_print_scripts admin_head-media-upload-popup and add css to match your needs. This can be done via the functions.php file or by creating a plugin. Here is the code in a plugin format to begin adding style: <?php /* Plugin Name: Some Name Description: Custom Thickbox Styles */ add_action(‘admin_head-media-upload-popup’, ‘custom_tb_styles’); … Read more

Refresh wp.media after ajax call

So, I followed your links and this is working for me. This test works the same for my upload callbacks so hopefully it works for you. In the iframe function myTab_save_frame() { global $redir_tab; $redir_tab = ‘mytab’; media_upload_header(); ?> <button>Test Trigger</button> <script> var switchAndReload = function() { // get wp outside iframe var wp = … Read more