top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to get author's information and show it into homepage in Wordpress?

0 votes
454 views

I am building a website using Wordpress. However, I have a "About" section on my homepage (index.php) and I would like to make it dynamic and want to show author's information on this section.
I was following a tutorial and they added the following code to show author's information in one of the page:

<?php the_author_meta( 'description' ); ?>

But that doesn't work on my homepage (index.php file). How can I do this? Can anybody help me?

posted Jun 5, 2017 by Ramya

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

You should use this in the index.php with the_author_meta like this:

the_author_meta('description', 12);

You have to include author ID here 12 and this way you'll make sure that there will be description there. You can find the author ID with get_user_by:

$the_user = get_user_by('email', 'foo@bar.com');
$the_user_id = $the_user->ID;
the_author_meta('description', $the_user_id);
answer Jun 20, 2017 by Biplab Roy
Similar Questions
0 votes

I want to create a database table with a column corresponding to the time in my wordpress site, so that I can save user actions into this table and know when they did it.

Creating a table:

$sql = "CREATE TABLE IF NOT EXISTS $table_name (
        id INT NOT NULL AUTO_INCREMENT,
        actiontime NOT NULL DATETIME,
        PRIMARY KEY (id)
    ) $charset_collSate;";
    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    // execute the query
    dbDelta( $sql );

Is this correct?

I would want a time stamp such that I can get the difference on minute/second intervals.

0 votes

I have a WordPress Blog which I updated regularly. I always updated my older post of my Wordpress Blog. I need a system that when I will updated any of my older post then the older post need to be shown at first as regular post. Can anybody help me?

0 votes

I am trying to make a custom form and insert into the database but when I click submit nothing happens. Please help me. I did research and changed my code but still same result. I don't know why.

This is the code:

<?php
/*
Template Name: Student
*/
get_header();
?>    
<?php echo "google";?>    
<?php

    if($_POST['Submit'])
        {
         global $wpdb;
         $name=$_POST['aname'];
         $roll=$_POST['aroll'];
         $dept=$_POST['adept'];
              if($wpdb->insert(    
                  'std', array(
                               'name' => $name,
                               'roll' => $roll,
                               'dept' => $dept
                               )
                               ) == false) wp_die('Database insertion failed');
     else 
          echo "<p>Database insertion successful</p>";  
?>
<?php
}
else //else we didnt submit the form, so display the form
{
?>
<form action="" method="post" id="addcourse">
<label> Student Name:<input type="text" 
name="aname" size="30" /></label>
<label> Roll:<input type="text" 
name="aroll" size="30" /></label>
<label> Department:<input type="text" name="adept" size="30" /></label>
<br />
<input type="Submit" id="addcoursesubmit" value="submit" />
</form>
<?php
}

{
}
?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
0 votes

I am developing a wordpress portal. I am sending html content(youtube iframe) with ajax from frontend pages. But while I am inserting that post wp_insert_post removes iframe codes in it. There is no problem with ajax or somewhere else. I guess there is somekind of filter. How can I disable that and insert iframe code?

Code before inserting -> $_POST["content"]

<div class="line nVideo" style="text-align: center;" ><iframe id="player" type="text/html" width="650px" height="380px" src="http://www.youtube.com/embed/mY8BZsIgg74?showinfo=1&amp;enablejsapi=1&amp;color=white&amp;origin=http://432designstudio.com" frameborder="0" allowfullscreen=""></iframe></div><div id="empty-line" class="nText " ><div>gasdgdsag</div>

And after insertation i call content again -> get_post_field('post_content', $postID)

<div class="line nVideo" style="text-align: center"></div><div id="empty-line" class="nText "><div>gasdgdsag</div>
...