I need a link that directs the user that is logged to his profile

I want a link in the form to an image in the frontpage, that direct the user that is logged to the subscription packages that are on its profile:

The link look like this: https://mywebsite.co.uk/author/admin/?screen=acc_pay

But I want for the user part /admin/ to change depending on the user that is logged.

I am using KingComposer:

This is the page were the link should be

And this is were it should lead undependant of the user that is logged in, so I need a customized link that leads to the author page of the user that is logged

This is the result of imputing this code

?php
$author_page = is_user_logged_in() ? get_author_posts_url( get_current_user_id() ) : NULL;
$acc_pay_page = $author_page ? add_query_arg( 'screen', 'acc_pay', $author_page ) : NULL;
if ( $acc_pay_page) {
    echo 'a href=' . esc_url( $acc_pay_page ) .'img src=https://mywebsite.co.uk/wp-content/uploads/2020/10/pricing-06.png //a';
} else {
    echo 'spanPlease log in/span';
}
?

Topic profiles subscription links users Wordpress

Category Web


You said that KingComposer will accept PHP blocks.
This will generate a link to the current logged-in user's author page:

<?php
$author_page = is_user_logged_in() ? get_author_posts_url( get_current_user_id() ) : NULL;
$acc_pay_page = $author_page ? add_query_arg( 'screen', 'acc_pay', $author_page ) : NULL;
if ( $acc_pay_page) {
    echo '<a href="' . esc_url( $acc_pay_page ) .'"><img src="account_page_page.png" /></a>';
} else {
    echo '<span>Please log in</span>';
}
?>

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.