Trying to get Authors ID

I m trying to show the user Score on a Quiz in their posts, I m adding this inside the Single.php loop:

    global $  wpdb;  $  user_id = the_author_ID(); $  table_name = "MYWP_quizresults"; $  sql = "SELECT * FROM ".$  table_name." WHERE user_id = ".intval($  user_id);  $  result = $  wpdb->get_results($  sql);     if(!empty($  result))                       {         foreach($  result as $  row){            echo "ID: ". $  row->user_id. " Name: ". $  row->user_name;     }  } 

Which forum CMS lets authors moderate their own topics ?

Hello I'm looking for a forum software to install on my website, that could let any author of a new topic moderate its topic with the same rights as a regular moderator, mostly by editing other members' replies.

I've joined a hundred of BBS (running most softwares) and none of them let the authors be moderate their own thread. Therefore I assumed it was not a built in feature, possibly because pyramidal moderation was the only one known to developers.

If there are too many forum CMS with…

Which forum CMS lets authors moderate their own topics ?

Exclude authors IDs from WP_Query

I am using this code, trying to exclude specific authors from WP_Query, however the author IDs in the array are not being excluded. Any ideas please?

<?php $  args  = array('meta_query' => array(array('who' => 'authors')),array( 'author__not_in' => array(10, 3, 4)) );$  site_url = get_site_url();$  wp_user_query = new WP_User_Query($  args);$  authors = $  wp_user_query->get_results(); ?> 

how to tag authors name in a blog post

I’m trying to tag authors name into the blogs that have been posted on a site. When i run the following code, it doesn’t show the authors name in tags.

add_action( ‘save_post’, ‘add_authors_name’, 10, 2); function add_authors_name( $ post_id, $ post ) {

// Check the post type to apply only to satandard posts. // Bypass if the $  post is a revision, auto-draft or deleted if( $  post->post_type == 'post' ) {      $  post_author = $  post->post_author;  // returns the Author ID     // get the author's WP_User object so we can get the Author Name     $  post_author_obj = get_userdata( $  post_author );     $  post_author_name = $  post_author_obj->first_name . ' ' . $  post_author_obj->last_name;      if( ! has_term( $  post_author_name, 'post_tag', $  post ) ) {          wp_set_post_terms( $  post_id, $  post_author_name, 'post_tag', true );      }   } } 

That is the code I saw online and decided to use it. It is suppose to add the authors name as a tag.

I went in to edit the functions.php file, I copied the code and Saw no changes at all to the articles.

wordpress -> wp-includes -> functions.php

So how would I tag the author in his own article? What changes am I making to the above code?

Enable Authors in Multiple Custom Post Types

I have found the below code to enable viewing the author of a custom post type and it works perfectly for one custom post type. But I need it to work for 4 custom post types called: detox, recipes, movements, lifestyle.

function add_author_support_to_posts() {    add_post_type_support( 'your_custom_post_type', 'author' );  } add_action( 'init', 'add_author_support_to_posts' ); 

What is the correct syntax to include all 4 custom post types?