Don’t working shortcode [anspress page=”user”] – showing Anonymous. Integration with WP Recall.
Hello. Thanks for the wonderful plugin, but recently I came across a problem. I’m trying to integrate a profile from AnsPress to WP Recall.
I tried using the shortcode [anspress page=”user”] but the shortcode only displays the anonymous profile.
The solution does not work:
Add it before “get_header()”:
$curr_user = wp_get_current_user();
set_query_var( ‘ap_page’, ‘user’);
set_query_var( ‘author_name’, $curr_user->user_login);
Maybe I’m doing wrong? I add the code to the template of the page where the shortcode is used, for example in page.php
In my case, it looks like this:
<?php
$curr_user = wp_get_current_user();
set_query_var( ‘ap_page’, ‘user’);
set_query_var( ‘author_name’, $curr_user->user_login);
get_header();
?>
Илья Попугаев Asked question