<?php
/**
 * @var $last_viewed
 * @var $args
 * @var $display_title
 */

if ( $last_viewed ) {

	query_posts( $args );

	if ( have_posts() ) {

		if ( $display_title == 'yes' ) { ?>

			<h4><?php _e( "Recently Viewed", "wpjobster" ); ?></h4>

		<?php } ?>

		<div class="recently-viewed-wrapper">

			<?php while ( have_posts() ) { the_post(); ?>

				<div class="recently-viewed-box">

					<div class="image">

						<a href="<?php the_permalink(); ?>">

							<img src="<?php echo wpj_get_job_image(); ?>" alt="" />

						</a>

					</div>

					<h5>

						<a href="<?php the_permalink(); ?>">

							<?php echo wpj_trim( get_the_title(), 55, '...' ); ?>

						</a>

					</h5>

				</div>

			<?php }

			wp_reset_query(); ?>

		</div>

	<?php } else echo '<style>.recently-viewed-row-wrapper{display:none;}</style>'; // for page builder

} else echo '<style>.recently-viewed-row-wrapper{display:none;}</style>'; // for page builder