WP rest api returns 404 only when author param is used

I’m facing the same problem with a Multisite running Wordfence and JWT. I’m not sure if the solution here works for your case… The following doesn’t work, it gives a 404 response. If we remove data.author it works without problem. jQuery.ajax({ url: ‘https://example.com/wp-json/wp/v2/posts’, method: ‘POST’, crossDomain: true, dataType: ‘json’, data: { ‘author’:’1′, ‘title’:’Hello world’, ‘content’:’lorem … Read more

What is wrong with this code?

You are using get_post_type as variable instead of a function try: function themeperauthor_need_switch() { global $post; if ( get_post_type($post) == ‘weblogs’ ) { return get_the_author_meta(‘themeperauthor’, $user->ID); } return “”; }

Editing the loop for Author pages

If your Parent Theme, has a template file loop-author.php, copy it to your Child Theme; otherwise, copy your Parent Theme’s loop.php template file to your Child Theme, and rename it as loop-author.php. Now, modify your Child Theme’s loop-author.php template file, in whatever way you wish. You don’t need to make any other changes, either to … Read more

get the username of a user in his author page

Take a look at the codex page on author templates – Author Templates Especially the $curauth object. In order to display author information on your author page, edit your author template file – author.php so that it figures out which author is being viewed, and retrieves all the information about the author from the database … Read more

WordPress Author Page

Under the plugin’s settings SEO > Indexation, scroll down to Archive Settings and make sure ‘Disable the author archives’ isn’t checked.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)