No, you’re right. This is the code that is responsible for ‘New’ span:
<?php if (strtotime($post->post_date) > strtotime('-14 days')): ?>
<div class="new-job-tag"><span>New</span></div>
<?php endif; ?>
The only problem with your modification is that there is no field called the_modified_date
in WP_Post object.
The proper name of that field is post_modified
, so your code should look like so:
<?php if (strtotime($post->post_modified) > strtotime('-14 days')): ?>
<div class="updated-job-tag"><span>Updated</span></div>
<?php endif; ?>
Related Posts:
- Display children and grandchildren of a custom post type
- WP_Query search posts by custom post type and custom taxonomy
- Conditional to modify query results
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- Can’t get order_by meta_value_num to work properly
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Very Slow Page – How to Optimize # of Queries?
- How to make sure content doesn’t display if selection is empty
- creat filter with wp_query
- Configuring a meta query with multiple post types that have the same relationship on a single page
- How can I group posts by months and years?
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- WP_Query Custom Post Type if Category ID Equals
- Is This Code Efficient – Or is there a better way?
- Different options per post type in WP_Query
- Show message when query has no posts
- Undefined $post in wp_query
- Custom post type and custom taxonomy 404 on page 2
- List latest post out of 2 custom post types
- Using Wp_Query, Json to add Highcharts series data
- foreach loop inside the loop creating duplicates in output
- Foreach loop returning more than one item when querying taxonomy
- Page that lists publications by classifying them by taxonomy
- set object terms after some some time of published post – functions.php
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value
- Sort custom post column by generated value?
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- wp_post_delete is deleting all offices
- Tell wordpress to show a single page instead of an archive page
- Search result based on URL
- Custom Taxonomy – fields
- Custom Post By Category
- How to get the posts that my following users are liked?
- CPT post doesnt shows tags and category on backend admin page
- The most recent post of custom taxonomy
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- Loop carousel slider in wordpress
- Values inside a custom field to determine which category posts to display
- WordPress multi-query not returning as expected
- Trying to combine multiple WordPress queries
- Custom Post-type not returning the right child_of
- Pagination not working on homepage
- Query Custom Post Type by Tag
- How to manage wordpress knowledge base/wiki/posts collections
- Store custom post type with JSON content
- Get Posts in a Custom Post Type category
- How to query for posts (in hierarchical custom post type) that have children?
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- How do you output custom code between posts in the loop?
- Get the next event using date_query
- How to make in WordPress admin panel sortable column for the custom field, that count the number of page impressions?
- Output custom post shortcode. Help spot the error.
- Blog page showing same content as homepage
- wpdb custom post_type problem
- Show custom post type filtered by category
- Get custom post type list for every category shortcode
- Filtering WP_Query
- How do i calculate the total of values of custom fields in custom post types?
- Custom post type – get_day_link()
- Custom post taxonomies as tax_query terms?
- Use custom metabox to update automatically a post after a given date
- get_post_meta not working on publishing
- Custom post type ‘articles’ ignores posts_per_page, reserved post_type?
- WP Query with categories only shows one post and ignores the category
- Different Category system needed for the Custom Post Type
- Can I display custom post types in home.php or need page template?
- Sort posts in loop by the WooCommerce Membership of the author
- WordPress wp_query() basic question about args
- Removing full title and breadcrumb header container for a specific post type
- Using Pagination for Custom Post Type and keeps returning 404
- Pagination for search results of custom post type [duplicate]
- Validate Custom Post Type fields
- meta query not retrieving posts
- WP_Query get post from a category and from another post type
- CPT Repeatable Fields + Undefined Index
- All blog posts are not showing up
- Custom post-type custom query – show all posts
- redirect after submiting post for review
- Get only parent post in archive post
- update custom taxonomy custom fields
- Filter posts by their related field’s custom field
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- How do I get all authors posts of a custom post type outside loop
- minimize wp_query call to database
- sorting in wp query based on custom field value
- Include images from pages in wp search.php results in default wp search
- Featured image in custom post is being disabled
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Is it possible to add query parameters on the archive page?
- Custom Search not working
- Storing/querying custom date data
- How do I hide single category post on my post page