Check out code below.
Function returns a number of posts published with todays date. You just have to modify a navigation a little bit to add this number counter to a menu bar.
echo "<h1>Today is: " . date("Y-m-d") . "</h1>";
function published_today() {
$counter = 0;
$posts = get_posts(array('numberposts'=>-1));
foreach ($posts as $post){
if (get_the_time('Y-m-d', $post->ID) === date("Y-m-d")) {
$counter++;
}
}
return "Posts published today: " . $counter;
}
echo published_today();
Related Posts:
- How to implement WordPress plugin update that modifies the database?
- WordPress Plugin Development In MVC Architecture, How?
- Customize plugin update “new version is available” text
- category_name not working (not showing up in sql query debug)
- “Donate to this plugin” for WordPress.org Plugin Authors
- What happens when two plugins have the same 3rd party class included into them?
- add_rewrite_rule, plugin activation and plugin deactivation
- Custom admin column disappearing when using Quick Edit [duplicate]
- Create page when plugin is activated
- How to handel multiple checkbox field in the admin settings page with Settings API
- Update Multiple Post Meta for the Same Post In One call?
- Allowing Custom Capability to Manage Plugin Options
- wp_insert_user – how to send verification email before logging in
- Custom plugin settings: clicking “save changes” does not display success message
- How to show custom message once on plugin activation?
- How do I configure WordPress to talk to a Microsoft SQL Server database?
- How can I translate the name of my Plugin for other languages?
- How to load a new template page according to a particular URL?
- How can I filter blog name?
- Logs to check when the plugin was first installed for the first time
- API to filter new user registration $POST data?
- Detect if a plugin was included in a certain page
- Set cookie then immediantly refresh the page
- How to add an attribute to the body tag with a plugin?
- Override the core function locate_template
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- Set user ID at time of wp_create_user
- How to Create a Custom Plugin Permalink
- How do I add a custom sub menu menu under Woo-commerce marketing?
- How to create custom tables in WordPress using my own plugin?
- How would I go about creating a user ranked post popularity page?
- How to modify WCMP Rest API response?
- Making a Template for a CPT created by a plugin
- Woocommerce dependent plugin
- External CSS in WordPress Plugin [closed]
- User Session and Stored Cookies not get removed
- get 404 when accessing wp-admin/plugin-install.php
- Woocommerce Minimum Price for a Composite Product to add in cart
- Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?
- Namespaced shortcode?
- How to pass variables to a function argument using add_action [duplicate]
- Activate my plugins via FTP
- Custom post types – remove default post supports through empty array?
- How to insert and call new data in wordpress website database through a plugin
- update_option_{$option} not showing old value
- How to be escape Variables and options when echo?
- Release the plugin in the WordPress repository where redux is used
- Dokan Marketplace store link in single product page
- A server-side hook failed when committing plugin code to SVN
- Development of plugins to add components like JqueryUI
- plugin enqueue style on all pages
- Using meta_query in a WP_Query not working for numbers properly
- why the wp_register_script doesn’t work for register_activation_hook
- How to add captcha to publish widget
- How to add logo to a WordPress Custom Plugin?
- Use a custom block in another block
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- GitHub plugins safe to use in my website?
- Using OR Condition with facetwp facets
- How to copy the all WordPress media items to another custom plugin folder?
- Personality quiz in wordpress using a plugin
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- Error on plugin activation and creating new page
- Child theme modifications not showing up
- Why is my shortcode not working?
- Link custom post type to page
- implement checkbox or toggle switch in plugin code
- wp_remote_post To external API multiple values with the same key
- wordpress form not saving or updating
- How to put a maximum real-time users limit
- Custom admin plugin read CSV
- what’s different between wpdb->prefix and table_prefix
- Can we rename a plugin directory for a already launched plugin?
- How can I call functions from a custom plugin?
- How to get short description under heading – Visual Composer [closed]
- plugin installing error
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- How can I use wp_ajax_response for front-end error reporting?
- How to create a new database table whenever user changes options
- Am I correctly adding styles to plugin?
- How can I insert a record into a custom table from my custom form in my custom admin page?
- how to create table during plugin installation in side a class
- WP_Filesystem usage within a block of code
- Why function hooked using object are executing at all time?
- What is the Object for WP_Error Class?
- How can I use multi Media Uploader in a plugin?
- Ajax in Plugins: returns the whole page
- Gutenberg: Dynamic Block – Show saved data in the editor
- How to fix ‘Call to undefined function do_settings()’ error?
- Any way to hook into WP after a page displays?
- How do I set register_meta for a specific CPT?
- How to Enfroce Domain Licensing Limits? [closed]
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Update Content for a Custom Block Toolbar Button
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Wrong block appender button showing
- Uncaught Error: Cannot use object of type stdClass while showing the list using WP_List_Table
- Submitting form to admin-post.php WordPress
- WordPress Throwing Deprecated Errors on its own Files
- plugin doesn’t retrieve data from database