• Resolved maximmmus

    (@maximmmus)


    Hi,

    If I add this code to functions file it will remove the time as well together with “on” and “at”. Only date will be visible.

    Do you have a code to remove only “on” and “at” and keep date and time?
    Thanks

    function tifd_fix_meta_output( $content ) {
    	//Change publication date from 
    	return str_replace( 'on', '', substr( $content, 0, strpos( $content, 'at' ) ) );
    }
    add_filter( 'feedzy_meta_output', 'tifd_fix_meta_output' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Hardeep Asrani

    (@hardeepasrani)

    Hey there,

    Trying using the following code instead:

    function tifd_fix_meta_output( $content ) {
    	return str_replace( array( 'on', 'at' ), array( '', '' ), $content );
    }
    add_filter( 'feedzy_meta_output', 'tifd_fix_meta_output' );

    Let us know if it works.

    • This reply was modified 6 years, 4 months ago by Hardeep Asrani. Reason: Improved code
    Thread Starter maximmmus

    (@maximmmus)

    Thanks! Yes it works indeed.

    Plugin Contributor Hardeep Asrani

    (@hardeepasrani)

    Glad to know. Have a great day ahead. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Removing only “on” and “at”’ is closed to new replies.