There is a shortcode you can use, documented here: http://docs.businessdirectoryplugin.com/misc/shortcodes.html
But that requires that you hard-code the username in it. We don’t yet have a shortcode to show the listings of a user when a name is entered.
That’s something we can consider for future development, but not something the plugin allows for today.
jomo
(@jonathanmoorebcsorg)
I suggest this, to add the listing to the standard author archive page:
/**
* Add CPTs to author archives
*
* @param WP_Query &$this The WP_Query instance (passed by reference).
*/
function custom_post_author_archive($query) {
if ($query->is_author)
{
$query->set( 'post_type', array('wpbdp_listing', 'post') );
}
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}
add_action('pre_get_posts', 'custom_post_author_archive');
Great suggestion @jonathanmoorebcsorg! Thanks for posting it.
Thread Starter
pre20
(@pre20)
It works, thanks!
It is possible to add it to a custom page, to not mix with the posts? Because some member plugins make a new profile page so the author page is no longer used and redirect it to the profile.
Hi @pre20,
I’m not sure I understand your question here–custom page for what? For the listings by a specific author?
Or are you talking about replacing the profile page for the user on the admin dashboard here?
Thread Starter
pre20
(@pre20)
Yes, I’m talking about show the user listings (implement that code) in a custom page like /user-posts instead of the author page.
Or in the user/name, because some plugin memberships replace the default author page by a custom profile page so to show them on it.
-
This reply was modified 8 years, 8 months ago by
pre20.
OK, we’ll definitely add that to the list for future development.