How to Add Custom New Published Post Counter Icon on Top of the WordPress Site [closed]

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 … Read more

Bulk updates to post_content

<?php /** * Plugin Name: Bulk Post Update * Version: 1.0.0 * * @author Nabil Kadimi <[email protected]> * $link http://wordpress.stackexchange.com/a/242499/17187 **/ add_action( ‘init’, function() { global $wpdb; $table = $wpdb->posts; $post_type=”custompost”; $new_post_content=”Text I want to update all my post content to”; $affected = $wpdb->query( $wpdb->prepare( “UPDATE {$table} SET post_content = %s, WHERE post_type = %s” … Read more