Tag Info

New answers tagged

0

You can retrieve the author page URL for any user by their user ID using the WordPress native function get_author_posts_url(). Combining this with get_users() to retrieve an array of users, you can create an author list in pretty much any way you like! Below is an example of the usage of get_author_posts_url(), displaying a link to the author page for the ...


0

You can set restrictions on individual users or roles too to post to a specific category using this plugin. Restrict Categories - WordPress Plugin Edit: It's really easy to use the plugin, it might be worth the time to check the link out. However, i'll still show you how to use it. After installing the plugin, you can go into Settings > Restrict ...


0

I had the same issue here when trying to make a widget that displayed featured posts with author information. I used some of the hint's from @chrisguitarguy 2nd tip. My code looked like this: <?php $count = 0; $query_args = array( 'posts_per_page' => 5, ); $com_query = new WP_Query( $query_args ); $feat_posts = $com_query->posts; ...


1

The ability to set comment status is tied to the "edit_comment" capability, which is a meta-capability in WordPress. It maps to the "edit_post" capability, which is another meta-capability that varies depending on whether a post is published or not. In the end, if a post is published, then edit_comment ends up mapping to "edit_published_posts" for the ...


0

You can remove the capability from the role entirely. It you can replace the PUT_ROLE_HERE with your role: $edit_role = get_role(PUT_ROLE_HERE); $edit_role->remove_capability('moderate_comments'); As @SierraTR says, only Administrators and Editor have access to moderate comments, unless you have some kind of Role Plugin.


0

According to the Codex: Roles_and_Capabilities both the Admin and Editor roles have the capability of managing comments. At the bottom of that Codex page under Resources there are a few plugins listed for easily changing the capabilities of user roles ( other than Administrator ) and there are references to functions you can use to change the capabilities ...


0

Your problem is totally related with pure PHP, not Wordpress. You must understand that includes DO NOT break the variable scope. So, the $curauth is only life in author_list.php file and, more specifically, only life inside the foreach($author_ids as $author) loop of that file. In your page template you could use the_author_meta() to get the author meta ...


3

If you are talking about author.php in your theme directory, usually at wp-content/themes/<YOURTHEMENAME> this isn't a core file but part of your theme. Themes don't get changed when WordPress is updated, so concerning WordPress updates themes are safe. But if your theme isn't custom made by you (which I assume here) this file would be changed if you ...


0

You can create a author.php file in your theme folder to make your custom author template. This is the tempalte hierachy for author view: author-{nicename}.php - If the author's nice name were rami, WordPress would look for author-rami.php. author-{id}.php - If the author's ID were 6, WordPress would look for author-6.php. author.php archive.php index.php ...


0

Use wpautop() https://codex.wordpress.org/Function_Reference/wpautop Example <?php ///MUST BE IN A LOOP echo wpautop(get_the_author()); ///MUST BE IN A LOOP ?> So you will need to find out where author name are being displayed in the code. Normally the default file is author.php


0

A filter on pre_get_posts should do it. function hide_author_wpse_138491($qry) { $exc = 123; if ( !is_admin() && !is_singular() ) { $qry->set('author','-'.$exc); } } add_action('pre_get_posts','hide_author_wpse_138491'); This should exclude results from the author with ID = 123 on all front end pages except for "single" ...



Top 50 recent answers are included