First thing’s first, we need to get our globals. If you’re in The Loop you can remove the global $post in my code, if you’re outside The Loop $post may not be what you expect it to be. We’ll always need the global $userpro though.
<?php
global $userpro,
$post;
?>
<div class="myrelatedauthor">
<a href="https://wordpress.stackexchange.com/questions/180751/<?php echo $userpro->permalink( $post->post_author ); ?>">
<?php echo get_the_author_meta( 'display_name', $post->post_author );?>
</a>
</div>
The key differences between your code and my code is that I include global $post and global $userpro. I also echo out the value returned from from $userpro->permalink().
Related Posts:
- How to auto-format code in Eclipse?
- Adding spaces in multiple lines simultaneously – in Pycharm
- can I add a custom format to the format option in the text panel?
- Change CSS/formatting on specific page, but not pages in general?
- How to change text size of Gutenberg editor
- Content over 10,000 characters won’t display with the_content()
- How to prevent automatic conversion of dashes to –
- Add dollar sign and commas to a number?
- Line breaks not showing up properly
- Use a language specific thousand separator
- Comment formatting with comment_content
- Formating the display of a post’s date, outside the Loop
- Formatting with
- How to define a custom font family for a wordpress blog that will not affect the entire site
- Keep formatting for tables copied from MS Word?
- Page formatting lost when I attempt a revision
- How to properly format if statement with html and php
- How can I prevent WordPress to wrap into a paragragraph
- Linebreaks behaving oddly inside blockquotes
- post_class() breaks out of formatting. . . extra markup also generated
- How to Prevent WordPress from Automatically Applying Inline Styles to Post Images?
- How do I format the date in Event Organizer?
- Images that copy code to clipboard when you click on them
- Formatting poetry in wordpress
- Trim content without stripping formatting
- How to remove filter apostrophe and single quotation
- Display KML (or other “raw data” file) nicely in WP?
- why doesnt my formatting work in my wisiwig editor?
- Formatting issues within Divi theme
- Preparing Hardcopy and Online Page
- how to display the web content which contain html code prolerly?
- Remove all paragraph tags
- How to prevent wordpress from autoformatting my posts once and for all?
- How do I display page content next to a contact form, rather than under it?
- Multiple item layout with one query
- Fix issue with displaced braces( )
- Formatting text in posts
- Is there a way to reorder a collection of posts to read from top (oldest) to bottom (newest)?
- How to add a spoiler without using shortcode-based plugins [closed]
- Can’t get blog entry to format properly using wp-load
- Paste Function Broken
- Moving formatted data in Salesforce rich text field into WordPress
- How can I remove punctuation from input text in Java?
- Format JavaScript date as yyyy-mm-dd
- Double decimal formatting in Java
- How to print a number with commas as thousands separators in JavaScript
- VBA: Convert Text to Number
- Nice way to print_r arrays
- remove tags from the_content
- Completely strip any hidden formatting when pasting into TinyMCE
- Remove wptexturize from a shortcode?
- Problem in wordpress with “-“
- Place page title in header?
- Automatically decrease font size for long words
- Pasting code into pre-formatted text in Visual Editor not working in 3.3.1
- How to get year, month and hour in WordPress?
- Updating to Version 4.5 bumped my “main sidebar” widget out of place
- Why is WordPress WYSIWYMG and how do I make it WYSIWYG?
- PHP library that can merge stylesheet with inline style [closed]
- Remove whitespace before the_excerpt();
- Why is this gutenberg custom format button only available from the toolbar as a dropdown?
- WordPress | Convert #038; to &
- How to Include HTML in Excerpts?
- Stop auto formatting in shortcodes
- Selectively remove empty line after line change
- Unautop / Sanitize content added to a post through a plugin
- Crafting WP_Query array, sort by date
- Remove add to cart icon/view product button woocommerce
- trigger html cleanup for all posts
- Posting blog entries in screenplay format
- Can’t format content of Rich Text Editor in Template
- How can I remove line breaks from manually formatted HTML?
- Space Not Being Generated in HTML Output?
- Multiple Rows in a using wp_query
- Special Formatting for WordPress Plugin Description?
- HTML tables in content areas
- Function sanitize_title() does not appear to be working
- WP Editor: Keep Bold, Underline, etc. but ignore color
- Using Microsift Word/Outlook for content publishing to WordPress
- All images on one line for each post
- Style wordpress image captions in RSS
- CSS appears to not work on any WordPress theme
- Email sent from WordPress has HTML tags
- Mystery line break
- get_the_term_list( get_the_ID() label formatting?
- Changing Date Format on Custom Meta Data w/shortcode call
- Object of class WP_Error could not be converted to string in /formatting.php
- How do I change the content of an element for a theme without losing the styling?
- Understanding automatic text formatting in the WordPress editor
- Let custom text widget use the same font as the theme
- Post formatting bug in WordPress
- Reformat data within a nested array
- Theme does not respect spaces between paragraphs in pages
- ACF loop and php formatting
- getpost content with all formatting for admin pages
- Add Default WordPress Formatting To Data From External SQL Tables?
- Custom formatting
- Date is showing in unreadable format. How to convert to readable date?
- How to show only text from post in WordPress
- Adding padding above menu