I have added a testimonial slider in WordPress Page but It is showing the dots at the bottom but I want the author name in place of dots. Can any one help me in this. I have also attached the UI sample.
Use the Wordpress function get_the_author_meta()
.
E.g. echo get_the_author_meta('first_name') . ' ' . get_the_author_meta('last_name');
will output the first name and the last name of the author. Instead of firstname
and lastname
, you could use following strings as parameter:
- admin_color
- aim
- comment_shortcuts
- description
- display_name
- first_name
- ID
- jabber
- last_name
- nickname
- plugins_last_view
- plugins_per_page
- rich_editing
- syntax_highlighting
- user_activation_key
- user_description
- user_email
- user_firstname
- user_lastname
- user_level
- user_login
- user_nicename
- user_pass
- user_registered
- user_status
- user_url
- yim
Now that you have the data, you need to replace the dots (...) with the data. Let's say the plugin that you are using does not support it and you don't want to edit the codes of your plugin. You could still use JavaScript!
PHP: Just output the value in a div with a class.
JavaScript: Then replace the selector of your dots (...) with the selector of the div that you have given.
E.g.:
document.querySelector('.dots').innerHTML = document.querySelector('.hidden-author').innerHTML;
.hidden-author {
display: none;
}
<div class="hidden-author">Author's name</div>
<div class="dots">...</div>