New answers tagged author
0
For Quick solution jut use substr
crop you link to desire position.
for ex:
$fb_url = substr('www.mysite.com/author/author_name/www.facebook.com/author_name',$position);
//$position is starting point from where croping start for you given string to retrieve facebook url.
1
Found it:
global $post;
$author_id=$post->post_author;
the_author_meta('user_nicename', $author_id );
0
Try this suggestion:
$user_id = get_current_user_id(); // Get current user Id
$user_groups = wp_get_object_terms($user_id, 'user-group', array('fields' => 'all_with_object_id')); // Get user group detail
foreach($user_groups as $user_gro)
{
echo $user_gro->name; // Get current user group name
echo $user_gro->taxonomy; // get current user ...
0
Ok, problem solved. I ditched the plugin and got another one called User Taxonomies. It does all the boring part of creating custom taxonomies (saving fields etc.) You will do just as well by writing it all yourself, but i wanted to keep my code clean.
After installing the plugin I registered my custom taxonomies manually like described on the plugin page, ...
2
http://codex.wordpress.org/Function_Reference/get_comments#Parameters
your problem is using author_email, you need user_id
i just use similar script.
<?php
$args = array(
'user_id' => $user->ID,
'number' => 10, // how many comments to retrieve
'status' => 'approve'
);
$comments = get_comments( $args ...
0
Check This Show Comments by User ID in WordPress
1
I think it might take some time for the google to update this information to the search index.
As far i've seen the older posts on my blog(multi user) show the author information in a google search. The latest posts don't really get updated with that information.
Feb 2013 post - > http://i.stack.imgur.com/9W1lP.png
A post few days ago - > ...
1
You can try this query that counts user comments by using the user_id field in the comments table as a filter:
function count_user_comments_today( $uid ){
global $wpdb;
$today = date('Y-m-d');
$tomorrow = date('Y-m-d', time() + 86400);
$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->comments} WHERE user_id = %d ...
1
I don't know of a way to directly pull this query with Core functions, but the SQL is simple.
$sql = "SELECT COUNT(comment_ID)
FROM {$wpdb->comments}
WHERE comment_author = 'admin'
AND DATE(comment_date) = FROM_UNIXTIME('".time()."')";
$a = $wpdb->get_var($sql);
You can alternately use something like AND DATE(comment_date) ...
1
Yes it's definitely possible. Refer to http://codex.wordpress.org/Function_Reference/get_comment, you'll need to get the current server time in UNIX format and then convert comment_date_gmt from each returned be using a foreach loop
function current_user_comments_today() {
global $comment;
global $current_user;
get_currentuserinfo();
$all_user_comments ...
1
I found the issue, thanks to @Toscho giving me the spark of an idea. We are using custom user roles and capabilities. It had something to do with the User Role Editor plugin. Deleted the custom role, and created a new one, reassigning all capabilities. Then updating all users to the newly created user role. Problem fixed.
Not sure why that happened, but ...
0
Got the answer, encase anyone else needs it, here it is.
<?php
$currauthor_id = get_the_author_meta('ID');
$terms = get_terms('your_taxonomy', array(
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
) );
foreach ( $terms as $term ) {
$myquery = new WP_Query( array(
...
0
Found out the solution for #1. using WP_Query I can specify multiple post_type and an author ID. which gives all author written data...
1
Your question is not very detailed or very clear but get_user_meta will return all of the user metadata for a user. That should have all of your fields.
You could also use get_users for the second tab. I am not dealing with the first since you state that your "have no idea how to do the 2nd one"
$args = array(
'fields' => 'all_with_meta',
...
2
Your PHP is wrong but what you are doing looks like it should work.
$count = $wpdb->get_var(
'SELECT COUNT(distinct comment_author)
FROM ' .$wpdb->comments. '
WHERE comment_approved = 1
AND comment_post_ID = '.$post->ID
);
echo $count;
Precisely, you were trying to use a variable inside single quotes, which doesn't work. ...
0
After the loop in single.php
<?php endwhile; // end of the loop. ?>
place this:
<?php
if ( current_user_can( 'editor' ) )
{
echo 'This is the editor';
}
elseif ( current_user_can( 'contributer' ) )
{
echo 'This is contributor';
} ?>
Now under the post, it will say 'This is the editor' or 'this is the contributor' based on the capability ...
1
Use global $authordata:
Testing for roles:
global $authordata;
if ( in_array( 'administrator', $authordata->roles ) )
{
echo 'Hello Admin!';
}
elseif ( in_array( 'editor', $authordata->roles ) )
{
// echo something else
}
Or testing for capabilities:
if ( ! empty ( $authordata->allcaps['manage_options'] ) )
{
echo 'The author can ...
0
maybe you can find a answer in my Question here: How does Wordpress Social Login plugin creates users in WP database?
I use Gravityforms to have users create only one page from front-end (using the page.php as template), and directs them to their newly created page after submission. (all inbuilt Gravityforms settings, except the function to create a page, ...
Top 50 recent answers are included

