Share WordPress Database

Does the WordPress installation has to use an exclusive database? If there are no table name conflicts, WordPress can share a database. Preventing conflicts is just a matter of setting a database prefix on install. By default, that prefix is wp_ but you can change it to anything you want within reasonable character limits. It … Read more

Custom single page based on which custom page template is selected

Yes it is possible using get_template_part(); Assuming that you use a standard single.php: <?php /* * Template name: template-blog-left * */ get_header(); ?> <div id=”left-sidebar”> <!– Here your left sidebar –> </div> <div id=”content”> <?php //This function will look for single.php file in your theme folder get_template_part( ‘single’ ); ?> </div> <?php get_footer(); ?>

add unique code required to register

Add a field on your registration form <label for=”secret_reg_code”>Secret Code: </label> <input type=”text” name=”secret_reg_code” id=”secret_reg_code” value=”” /> then in your plugin file or in function.php add define(‘MY_SECRET_REG_CODE’, ‘fdsfgadsfgdf’); function check_for_reg_secret_code($errors, $sanitized_user_login, $user_email) { if ( defined(‘MY_SECRET_REG_CODE’) && trim($_POST[‘secret_reg_code’]) != MY_SECRET_REG_CODE ) { $errors->add( ‘secret_code_error’, __(‘<strong>ERROR</strong>: Enter a valid code postal code.’, ‘your_text_domain’) ); } return … Read more

Adding pages to the Admin panel

If I get you correctly, you are trying to add a new menu to the Admin Panel. For that, the following tutorial would be one of the best for you to such: The Complete Guide To The WordPress Settings API (Part I – VIII) The key things are: add_menu_page() add_submenu_page() add_theme_page() – for theme options … Read more

Logged in only custom page

You can redirect non logged in users to login page using following code if they access custom.php page link. Create custom_login.php as custom template and assign it a page, in the code below i have assigned it to a page “login page” having slug “login-page” function redirect_to_login(){ if( ! is_user_logged_in() && is_page_template(‘custom.php’) ){ wp_redirect( home_url() … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)