Title: Insert the date
Last modified: June 1, 2017

---

# Insert the date

 *  Resolved [quaglia37](https://wordpress.org/support/users/quaglia37/)
 * (@quaglia37)
 * [9 years ago](https://wordpress.org/support/topic/insert-the-date/)
 * Congratulations on the wonderful plugin
    Can I enter the date for each post shown?
   There is a style in which posts rotate continuously as in breaking news
 * Thank you

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Benaceur](https://wordpress.org/support/users/benaceur/)
 * (@benaceur)
 * [9 years ago](https://wordpress.org/support/topic/insert-the-date/#post-9189391)
 * If I understand correctly, you want to add the date of post before or after the
   title? If so, which animation is selected
 *  Thread Starter [quaglia37](https://wordpress.org/support/users/quaglia37/)
 * (@quaglia37)
 * [9 years ago](https://wordpress.org/support/topic/insert-the-date/#post-9189478)
 * I want to add the date before the title, scroll left animation
    Thank you
 *  Plugin Author [Benaceur](https://wordpress.org/support/users/benaceur/)
 * (@benaceur)
 * [9 years ago](https://wordpress.org/support/topic/insert-the-date/#post-9192771)
 * first: update the plugin to last version 2.5.6
    after: put this code in functions.
   php file of your active theme:
 *     ```
       function ben_ntb_funct_filter_title( $string, $ntb ) {
       	// filter title news-ticker-benaceur http://benaceur-php.com/?p=1747
       	# 'd M Y H-i'| d/m/Y H-i
       	$d = '<div class="ben_ntb_funct_filter_title"><div class="ben_ntb_funct_filter_title-str s1">';
           $d .= date_i18n( 'd/m/Y', strtotime( $ntb[0] ) );
       	$d .= '</div>';
   
           return $d.'<div class="ben_ntb_funct_filter_title-str">'.$string.'</div></div>';
       }
       add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
   
       function ben_ntb_funct_filter_title_style() {
       	echo '<style>
       	.ben_ntb_funct_filter_title-str.s1 {color:red;font-weight: bold;font-size: 12px;padding:0 3px;} 
       	.ben_ntb_funct_filter_title .ben_ntb_funct_filter_title-str {display:inline-block;}
       	</style>';
       }
       add_action( 'wp_head', 'ben_ntb_funct_filter_title_style' );
       ```
   
 * To display the author change this line:
    `$d .= date_i18n( 'd/m/Y', strtotime(
   $ntb[0] ) );` to: `$d .= $ntb[1];` and to display the post modification date 
   change to: `$d .= date_i18n( 'd/m/Y', strtotime( $ntb[2] ) );` and to display
   comment count change to: `$d .= $ntb[3];` To change the format of the date see
   this post: [https://codex.wordpress.org/Formatting_Date_and_Time](https://codex.wordpress.org/Formatting_Date_and_Time)
   example: change this ‘d/m/Y’ to ‘d M Y H-i’
 *  Plugin Author [Benaceur](https://wordpress.org/support/users/benaceur/)
 * (@benaceur)
 * [9 years ago](https://wordpress.org/support/topic/insert-the-date/#post-9192913)
 * and this without style:
 *     ```
       function ben_ntb_funct_filter_title( $string, $ntb ) {
       	// filter title news-ticker-benaceur http://benaceur-php.com/?p=1747
           $d = date_i18n( 'd/m/Y', strtotime( $ntb[0] ) );
   
           return $d.': '.$string;
       }
       add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
       ```
   
 * or:
 * `return '[ '.$d.' ] '.$string;`
    or number of comments:
 *     ```
       function ben_ntb_funct_filter_title( $string, $ntb ) {
       	// filter title news-ticker-benaceur http://benaceur-php.com/?p=1747
           $d = $ntb[3];
   
           return '[ comment(s): '.$d.' ] '.$string;
       }
       add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
       ```
   
 * author:
 *     ```
       function ben_ntb_funct_filter_title( $string, $ntb ) {
       	// filter title news-ticker-benaceur http://benaceur-php.com/?p=1747
           $d = $ntb[1];
   
           return '[ author: '.$d.' ] '.$string;
       }
       add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
       ```
   
 * Date of the last modification of the post:
 *     ```
       function ben_ntb_funct_filter_title( $string, $ntb ) {
       	// filter title news-ticker-benaceur http://benaceur-php.com/?p=1747
           $d = date_i18n( 'd/m/Y', strtotime( $ntb[2] ) );
   
           return '[ modified: '.$d.' ] '.$string;
       }
       add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
       ```
   
    -  This reply was modified 9 years ago by [Benaceur](https://wordpress.org/support/users/benaceur/).
    -  This reply was modified 9 years ago by [Benaceur](https://wordpress.org/support/users/benaceur/).
    -  This reply was modified 9 years ago by [Benaceur](https://wordpress.org/support/users/benaceur/).
 *  Thread Starter [quaglia37](https://wordpress.org/support/users/quaglia37/)
 * (@quaglia37)
 * [9 years ago](https://wordpress.org/support/topic/insert-the-date/#post-9193090)
 * I’ll try
    Thank you
 *  Thread Starter [quaglia37](https://wordpress.org/support/users/quaglia37/)
 * (@quaglia37)
 * [9 years ago](https://wordpress.org/support/topic/insert-the-date/#post-9193222)
 * Great work, it works fine
 *  Thread Starter [quaglia37](https://wordpress.org/support/users/quaglia37/)
 * (@quaglia37)
 * [9 years ago](https://wordpress.org/support/topic/insert-the-date/#post-9193225)
 * You can see it here
    [http://www.usolimpic.it/](http://www.usolimpic.it/)
 *  Thread Starter [quaglia37](https://wordpress.org/support/users/quaglia37/)
 * (@quaglia37)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/insert-the-date/#post-9195983)
 * It would be interesting to insert the continuous roll animation, separating posts
   with a line and keeping the link
    Thanks for your help

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Insert the date’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/news-ticker-benaceur_f7b23e.svg)
 * [news ticker benaceur](https://wordpress.org/plugins/news-ticker-benaceur/)
 * [Support Threads](https://wordpress.org/support/plugin/news-ticker-benaceur/)
 * [Active Topics](https://wordpress.org/support/plugin/news-ticker-benaceur/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/news-ticker-benaceur/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/news-ticker-benaceur/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [quaglia37](https://wordpress.org/support/users/quaglia37/)
 * Last activity: [8 years, 12 months ago](https://wordpress.org/support/topic/insert-the-date/#post-9195983)
 * Status: resolved