dongqiao6445 2018-05-25 06:53
浏览 54

一个“新”标签,仅显示不到7天的上传作业列表

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.

new label next to job listing.

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>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
    • ¥20 Java-Oj-桌布的计算
    • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
    • ¥20 有人知道这种图怎么画吗?
    • ¥15 pyqt6如何引用qrc文件加载里面的的资源
    • ¥15 安卓JNI项目使用lua上的问题
    • ¥20 RL+GNN解决人员排班问题时梯度消失
    • ¥60 要数控稳压电源测试数据
    • ¥15 能帮我写下这个编程吗
    • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路