Declare global var from Template File and use it in Functions.php

You can use the exact same filter in your template files. If you do need it in functions.php for any reason (maybe you have some additional processing) then you can use your own custom filter. functions.php: function my_custom_authorpage_title( $title ) { // process … return apply_filters( ‘my_title’, $title ); } add_filter( ‘wpseo_title’, ‘my_custom_authorpage_title’ ); author.php … Read more

Displaying the author of next and previous posts in pagination?

Yes, you can do that. Change <?php previous_post_link(); ?> and <?php next_post_link(); ?> with the following code: For previous post: <?php $prev_post = get_previous_post(); $prev_user = get_user_by( ‘id’, $prev_post->post_author ); if (!empty( $prev_post )): ?> <a href=”https://wordpress.stackexchange.com/questions/248618/<?php echo $prev_post->guid ?>”><?php echo $prev_post->post_title ?> (<?php echo $prev_user->first_name . ‘ ‘ . $prev_user->last_name; ?>)</a> <?php endif ?> … Read more

Changes show up in view source but not live site

You are echoing the author link generator inside an already opened anchor tag, which is causing error. Try this code: Method 1 <?php if ( !is_page() ) : $author_posts_url = the_author_link(); $posts_by_title = sprintf( __( ‘Posts by %1$s ( @%2$s )’, ‘p2-breathe’ ), get_the_author_meta( ‘display_name’ ), get_the_author_meta( ‘user_nicename’ ) ); ?> <a href=”https://wordpress.stackexchange.com/questions/251479/<?php echo esc_url( … Read more

How do I create WordPress Authors Dropdown with links

I could be wrong as I don’t know how WordPress controls the dropdown menu but looks like it could be only returning a name of the author and not a link to their page. I have tested the below code in a WordPress site environment and works including linking to the authors page. <select name=”author-dropdown” … Read more

Creating User Profiles using author.php

get_the_author_meta( ‘ID’ ) gets the ID of the author of the current post. If there’s no post there’s no author. Use get_queried_object_id() instead. When used on author archives (i.e. author.php) it will be the ID of the author, regardless of whether or not they have posts.

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