Skip to content

Instantly share code, notes, and snippets.

@jreviews
Last active October 22, 2021 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jreviews/cea3428c721595f023d916d3be9b4104 to your computer and use it in GitHub Desktop.
Save jreviews/cea3428c721595f023d916d3be9b4104 to your computer and use it in GitHub Desktop.
PeepSo About Author Snippet in JReviews

The PeepSo About Author output is not present in the JReviews listing detail pages by default. If you want to add it back you can use the following code snippet in the listing detail page or even in the php output format of a banner custom field.

echo PeepSoTemplate::exec_template('blogposts','author_box', 
	['author' => PeepSoUser::get_instance($listing['User']['user_id'])],
	true
);

You can also add the code after the listing description without template customizations using a JReviews action hook:

Clickfwd\Hook\Action::add('template_listings.detail:after-description', function($instance, $listing) 
{
	echo PeepSoTemplate::exec_template('blogposts','author_box', 
		['author' => PeepSoUser::get_instance($listing['User']['user_id'])],
		true
	);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment