I have researched and tried myself for days now, that's why I turn to the community.
I have a job board which runs on the WP Job Manager Plugin. I want to have a new
label next to all uploaded job positions that are less than 7 days old. I have attached a screenshot of a "new" label so that you get what I am looking for.
I have also included my PHP code for the job-listing as I believe this is were it can be added.
I would be more than grateful for any advice on this!!
Thanks very much, Markus
<?php
/**
* Job listing in the loop.
*
* This template can be overridden by copying it to yourtheme/job_manager/content-job_listing.php.
*
* @see https://wpjobmanager.com/document/template-overrides/
* @author Automattic
* @package WP Job Manager
* @category Template
* @since 1.0.0
* @version 1.27.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
global $post;
?>
<li <?php job_listing_class(); ?> data-longitude="<?php echo esc_attr($post->geolocation_lat); ?>"
data-latitude="<?php echo esc_attr($post->geolocation_long); ?>">
<a href="<?php the_job_permalink(); ?>">
<?php the_company_logo(); ?>
<div class="position">
<div class="company">
<?php the_company_name('<strong>', '</strong> '); ?>
<?php the_company_tagline('<span class="tagline">', '</span>'); ?>
</div>
<h3><?php wpjm_the_job_title(); ?></h3>
</div>
<input class="apply_button" value="Jetzt bewerben" type="button"/>
<div class="location">
<?php the_job_location(false); ?>
</div>
<ul class="meta">
<?php do_action('job_listing_meta_start'); ?>
<?php if (get_option('job_manager_enable_types')) { ?>
<?php $types = wpjm_get_the_job_types(); ?>
<?php if (!empty($types)) : foreach ($types as $type) : ?>
<li class="job-type <?php echo esc_attr(sanitize_title($type->slug)); ?>"><?php echo esc_html($type->name); ?></li>
<?php endforeach; endif; ?>
<?php } ?>
<li class="date"><?php the_job_publish_date(); ?></li>
<?php do_action('job_listing_meta_end'); ?>
</ul>
</a>
<div class="li_base single_job_listing">
<div class="job_description">
<?php wpjm_the_job_description(); ?>
</div>
<?php
$sharingbox_social_icon_options = array(
'sharingbox' => 'yes',
'icon_colors' => Avada()->settings->get('sharing_social_links_icon_color'),
'box_colors' => '#f6f6f6',
'icon_boxed' => Avada()->settings->get('sharing_social_links_boxed'),
'icon_boxed_radius' => Fusion_Sanitize::size(Avada()->settings->get('sharing_social_links_boxed_radius')),
'tooltip_placement' => Avada()->settings->get('sharing_social_links_tooltip_placement'),
'linktarget' => Avada()->settings->get('social_icons_new'),
'title' => $title,
'description' => Avada()->blog->get_content_stripped_and_excerpted(55, get_the_content()),
'link' => get_permalink(get_the_ID()),
'pinterest_image' => ($full_image) ? $full_image[0] : '',
);
?>
<div class="fusion-sharing-box fusion-single-sharing-box share-box">
<?php echo Avada()->social_sharing->render_social_icons($sharingbox_social_icon_options); // WPCS: XSS ok. ?>
</div>
<?php if (candidates_can_apply()) : ?>
<?php get_job_manager_template('job-application.php'); ?>
<?php endif; ?>
</div>
</li>