add role on WordPress in PHP on a second database

I managed to solve after several attempts using the following code: // Insert the role $role = array(‘gold_role’ => 1); $serialized_role = serialize($role); $DB_MEMBERSHIP->insert(‘wpvm_usermeta’, array(‘user_id’ => $user_id, ‘meta_key’ => ‘wpvm_capabilities’, ‘meta_value’ => $serialized_role)); It works very well and doesn’t slow down the shopping experience.

Require()/Include() post template adding extra content

The problem is within the get_post function. After looking through the documentation for include() and require(), which includes the *_once() variations of the functions, the problem seemed to be that it was returning a Boolean on whether the template had been included/required or not without throwing an error. After changing how the template was requiring/including … Read more

Infinite next / prev post in single.php page

I think this is a better and cleaner approach of what you are trying to achive. // get_adjacent_post will return $post object $prev_post = get_adjacent_post(true,”,true); //Using get_the_post_thumbnail() to get featured image of previous post $prev_thumbnail = get_the_post_thumbnail( $prev_post->ID, array( 100, 100)); $next_post = get_adjacent_post(true,”,false); //Using get_the_post_thumbnail() to get featured image of next post $next_thumbnail = … Read more