SFTP define in wp-config.php

Do you mean SFTP or FTPS? For SFTP you need to enable libssh2-php on your server and link it to your PHP and restart your ssh, you can get the downloads here http://www.libssh2.org/ Once you install that you should automatically see SFTP/SSH option in your admin under “Connection”, though I believe there was some recent … Read more

Using global $post; with custom post types

How about this? (Add to your theme’s functions.php file, or to a plugin.) function new_post_alert() { global $post; $ageunix = get_the_time( ‘U’ ); $days_old_in_seconds = time() – $ageunix; $days_old = $days_old_in_seconds / 86400; $post_type = get_post_type(); if ( ( $days_old < 3 ) && ( ‘news’ === $post_type ) ) { ?> <script type=”text/javascript”> jQuery(document).ready(function($){ … Read more

The $post variable – Did I get the grasp of how the Backend actions get parsed?

As I’ve already wrote in question comments, at the very beginning of creating the new post or page first choose a template and save as draft. Meta box will appear after save if right template is used. <?php add_action( ‘add_meta_boxes’, ‘my_add_meta_box’ ); function my_add_meta_box() { // get template file name $template_basename = wp_basename( get_page_template() ); … Read more

No access to global variables?

To answer your question directly, yes, $wpdb is “auto loaded and set up to global by WordPress” but by loading wp-content/themes/roots/script.php directly you are skipping over the WordPress boot process and loading the file exactly as if WordPress did not exist. That is why the normal WordPress objects and constants aren’t available. They haven’t been … Read more

Is a multisite install what I need?

Yes, a multisite is what you need. The membership part is arguably a separate question, and there are many ways of doing it. I would suggest a dedicated members site users register to, but there are lots of other ways of doing it, and there is no definitive answer. See here for what to do … Read more

How to save a viewer specific option

Is there a standard interface in WordPress for saving a global PHP variable $bgcolor to the user and read it from him anytime he browses to another blog page. There is nothing that will automagically do it for you but it sounds like you just need to save a little bit of user meta, and … Read more

how do i register global query in template

Declare an array at the start of your layout, or in your functions file depending on the scope required and populate the array with all the bands using get_posts and making the key the post ID. You will then have a global array of bands, and can pull info from each one wherever you need … Read more

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