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

Including a function into a theme

If you mean to attach it to any and all $_POST inputs in WordPress that’s probably falls under Bad Ideas. WordPress has some kinks in how it works with that data (for example it emulates “magic quotes” mode, long deprecated in PHP itself) and some cases of POST in WP are extremely heavy (saving menus … Read more

When new user register then add new user role

The user_register hook passes the parameter $user_id to your function. Get the login name after instantiating a user object with get_userdata( $user_id ). Update the assigned user role with wp_update_user. Alternatively, you can use add_role to assign the new role in addition to the currently assigned role instead of removing the currently defined role with … Read more

is_front_page not working in functions.php

Even though this question may get down voted – because not enough information has been provided and it’s fairly easy to find tutorials elsewhere, I’ll help you out. In your functions.php file in your theme, you need to do this: add_action( ‘wp_enqueue_scripts’, ‘wp5849_scripts’ ); function wp5849_scripts() { if ( is_front_page() ) : wp_enqueue_style(‘TBDhome’, get_stylesheet_directory_uri() . … Read more

How to update WordPress and plugins at specific day and time in PHP?

There’s a question and an answer regarding WP (auto) updates here, How To/What triggers a WordPress auto update? The answer also has a link to a blog post on how to force WordPress auto-update. Code snippet posted on the referenced blog, <?php // request-update.php require( dirname(__FILE__) . ‘/wp-load.php’ ); wp_maybe_auto_update(); ?> and php ./request-update.php Perhaps … Read more