Tag Info

New answers tagged

2

You need to add the following code to content-page.php in your theme folder. <?php the_author(); ?>


1

If I have understood correctly you should be able to edit your page template to include the below. I'm not sure on any plugin to do this though. More info: https://codex.wordpress.org/Function_Reference/get_the_author <?php $author = get_the_author(); echo "$author"; ?> ** This is untested


0

I find what was missing ($wp_query->queried_object_id;), here is answer: $current_browsing_author = $wp_query->queried_object_id; // Get current browsing author $sticky = get_option( 'sticky_posts' ); rsort( $sticky ); $sticky = array_slice( $sticky, 0, 5000 ); query_posts( array( 'post__in' => $sticky, 'author' => $author, 'orderby' => ...


2

Sebastien's answer got me on the right track. I should not be using the_author, because I am not looking for the author of a post (My query is not returning a post, but a user), rather the name of the user. I changed: echo get_the_author($spost->ID); to echo $spost->display_name;


2

get_the_author() takes no arguments and must be used within the Loop (I guess it's the case). /* get_the_author($spost->ID); Replace this. */ get_the_author(); // By this.


0

You do this with URL Rewriting. Locate your .htaccess file and add this line above # BEGIN WordPress RewriteEngine On RewriteRule ^author/(.*)$ /team/$1 [R=301,NC,L] Note, if you put this inside the wordpress block it will get rewritten next time your permalinks are regenerated.


1

You can override the author link via the author_link filter: function wpd_author_link( $link, $author_id, $author_nicename ){ return 'http://my.blog.tld/'; } add_filter( 'author_link', 'wpd_author_link', 20, 3 ); $author_id and $author_nicename are available to the filter so you can fetch whatever data you need to generate the correct link.


1

This is a bad idea and you might as well just give those users "higher" roles as with the "unfiltered_html" permission it is not very hard to duplicate the admin authorization cookies and take control of the site. What you should do is to teach them to use the built-in functionality of oEmbed, which should be enough to embed content from many sites in a ...


1

The capability you are after is called "unfiltered_html". Some options: Modify author capabilities in your theme functions.php. This is saved in the DB, so you can access a page, make sure it works then remove it from your functions.php file. A better option would be to run it on theme activation. See this page on WP Codex for options: ...


0

Here we go, found a nice thread which gave some answers and developed this which works a treat: if ( class_exists( 'coauthors_plus' ) ) { $co_authors = get_coauthors(); foreach ( $co_authors as $key => $co_author ) { $co_author_classes = array( 'co-author-wrap', 'co-author-number-' . ( $key + 1 ), ); ...


0

The obvious answer is to use get_avatar() twice using different author IDs. As you must be aware given your code above (assuming that is your code and not code cribbed from elsewhere), the first parameter of that function accepts an author ID or the associated author email address. However, you don't explain how you have associated multiple authors to the ...



Top 50 recent answers are included