get_the_time('U')
returns $string
. You cannot subtract a string from an integer
function new_badge(){
if ( (time() - strtotime ( get_the_time( 'U' ) ) ) <= (3*86400)) {
echo '<div class="new"></div>';
}
}
Related Posts:
- List all subcategories from category
- Get the children of the parent category
- Remove parent category from permalink? Basically only have the child category?
- How to remove the term “category” from category pagination?
- Force WordPress to Show Pages Instead of Category
- Display all posts in category, with specific tag posts at top
- Send an email when custom post type category is changed
- How to Set an Individual Homepage for Each User?
- Is there a way to remove categories in bulk?
- Remove specific category from a post
- Is it possible to put next and previous category links?
- Custom category template pagination problem
- Getting category before saving post
- How do I change the sql query for wp_get_archive()
- Woocommerce – Get product category 2nd level category
- Hide post meta data on a specific category
- New categories are now going to 404s
- How can I get an tag to wrap each ancestor that gets outputted in this condition?
- How to prevent empty category to list content of sub categories?
- “Reversable” and “Re-useable” Subcategories (or other taxonomic structure)
- Is it possible to have WordPress not recognize category URLs?
- Disallow categories from this MySQL query
- Use a wordpress page to display a certain category
- Insert Into Sub-child Menu
- How to list child categories?
- Search Posts / Pages with multiple options?
- Creating gallery with taxonomy images plugin?
- Full text articles in the rss feed (i.e. without the more tag)
- Solution for ascending order in a category
- Why do my categories redirect?
- Restoring default article pagination on archives – Removing custom limits
- Read GET parameters in APACHE Mod Rewrite rules for WordPress categories in Posts
- how to get child category title and image
- How to display all the categories a post is in
- Why don’t posts show up in my categories on the frontend?
- Should I use “Categories ” or “Pages” for a WordPress Static Site (A non blog site)?
- How do I query_posts in cat=1 AND not in cat=2
- Display single category name in woocommerce loop
- Show Posts from Single Category Not Working
- Functions.php: Exclude Category from “Blog”
- Use premade array as categories in wp_query?
- How do I get category and page ID’s?
- Category images are not displaying in WordPress
- Some categories missing on wp-admin/edit-tags.php?taxonomy=category
- Show child taxonomies (that have posts) of the current parent taxonomy
- Multiple selection for wordpress widget
- Get next post in same category not working WP 4.7.4
- How do you use the featured image of the most recent post in a category as the background image
- How do I retrieve the category ID (ugly permalinks) in my sub-navigation menu?
- function query_posts disabling current_page_menu class
- Using if statement in index.php instead of creating separate template files
- post_categories array using variable
- Pagination doesn’t work on multiple categories
- Multiple category posts on one page
- Query from multiple category (and)
- Wp Dropdown Category Not Show Current As Title
- How to load several hierarchical categories from functions.php
- How to get category names in post_class?
- How to get the deleted category id?
- Maintaining a separate posts page for certain categories and don’t show those on home page
- wp_list_pages() not showing on posts
- WP E-Commerce WPEC 3.8 Sort Categories
- How do I list only children of a specific category in a drop-down?
- Link posts together (relative, not grouped)
- Creating a Blog with numerous categories
- Conditional widget for theme template file
- Help to display the current categories and tags of a post
- How Can I Use Equal And Question Mark In Category Slug?
- How to hide description on categories and tags?
- Exclude a category from block editor’s category widget
- Replace deprecated get_category_children code with get_terms
- Retrieving Categories based on the first character of the name
- Woocommerce: all products of all categories instead products of one category
- Ajax load more not working with multipler categories
- Image Upload Custom Form Field for Category and Custom Taxonomy
- Redirect Category pages to blog page with query string
- Category custom template is not showing correct posts
- Woocommerce change tag_id to name
- Im trying to add a div for just one category
- Using template file for single post in sub-directory multisite
- Too many categories drastically slow down my website
- get_adjacent_post_link excluded_terms ignored
- Include category name in page template
- Category base 404 – fix
- Create Cross Promoting Categories in WordPress Using ‘pre_get_posts’
- How do i hide categories from menus which don’t yet contain posts?
- Re writing Category Argument
- Categories to A News Page
- How to include first assigned category in the post URL?
- Restricting certain blog posts by date?
- Duplicate homepage to show posts from 1 category
- Determine the category that an archive-page is for
- Easiest way to display post archives in category-then-alphabetical order?
- Printing out Category and all Category Children on category.php
- Call function on a single page
- Help Me “in_category” with echo? [closed]
- Can i know if it is Category first page or 5th?
- How to display posts by author in a separate page, other than author.php?
- One color to category link depending on category ID
- Show subcategories and hide posts or show posts if not exists subcategories