Display only entire most recent post on author page?

First, you need to create an author.php file, or edit the one that your theme has, in my case, I did the test with the twentyseventeen and it doesn’t have an author.php file, so I created it. <?php /** * The template for displaying all single posts * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post * * @package WordPress … 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.

Display Author role in archive or author page

$authordata is not available before the first post is set up (before the first the_post();). But all the data you need are already there on an author archive: in get_queried_object(). It is a WP_User Object on the author archive. print ‘<pre>’ . htmlspecialchars( print_r( get_queried_object(), TRUE ) ) . ‘</pre>’; Result: WP_User Object ( [data] … Read more

Custom Author Fields + Existing Taxonomy – Integrating the Two Dynamically?

Figured it out, for anyone who needs help with this I’m sure you can use with categories/tags as well (can also use with radio inputs and checked=”checked”: <tr> <th><label for=”sorority”><?php _e(‘Sorority is…’) ?></label></th> <td><?php $sorority = get_the_author_meta( ‘sorority’, $user->ID ); ?> <select name=”sorority” id=”sorority”> <?php $terms = get_terms(‘sorority’); foreach ( $terms as $term ) { … Read more

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