我已经研究并尝试了几天,这就是我转向社区的原因。
我有一个在WP Job Manager插件上运行的工作板。我希望在不到7天的所有上传职位旁边都有一个new
标签。我附上了一个" new"标签,以便你得到我想要的东西。
我还在工作列表中包含了我的PHP代码,因为我相信这是可以添加的。
对于这方面的任何建议我都会非常感激!!
非常感谢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>