• Resolved jward222002

    (@jward222002)


    I am trying to get my events to scroll but only today’s events. I’m sure this should be pretty easy, but I’m not able to find the setting to limit it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sayan Datta

    (@infosatech)

    Hi @jward222002

    Update this plugin to the latest version i.e. 1.0.3 and add this code to the end of your active theme’s functions.php file:

    function spt_post_ticker_todays_post( $args ) { 
        
        $today = getdate();
        $args['date_query'] = array(
    		array(
    			'year'  => $today['year'],
    			'month' => $today['mon'],
    			'day'   => $today['mday'],
            ),
        );
    
        return $args;
    }
    
    add_filter( 'spt_ticker_custom_query', 'spt_post_ticker_todays_post', 10, 1 );

    Thanks!

    Thread Starter jward222002

    (@jward222002)

    Thanks for the quick response, when I added that to my file I got the following error.

    Fatal error: Cannot redeclare spt_post_ticker_todays_post() (previously declared in /usr/share/wordpress/wp-content/plugins/simple-posts-ticker/public/render.php:190) in /usr/share/wordpress/wp-content/themes/glades/functions.php on line 194

    Plugin Author Sayan Datta

    (@infosatech)

    Hi @jward222002

    Use this:

    function spt_post_ticker_filter_todays_post( $args ) { 
        
        $today = getdate();
        $args['date_query'] = array(
    		array(
    			'year'  => $today['year'],
    			'month' => $today['mon'],
    			'day'   => $today['mday'],
            ),
        );
    
        return $args;
    }
    
    add_filter( 'spt_ticker_custom_query', 'spt_post_ticker_filter_todays_post', 10, 1 );

    Thanks!

    Thread Starter jward222002

    (@jward222002)

    That got rid of the error message, but now the ticker area is only showing the top border of my widget (text widget that has the short code in it). Unfortunately this is a self hosted internal site so I can’t give you a link to it, but I can send screen shots if you have an email of Facebook messenger that I can use.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Events’ is closed to new replies.