Ready to get started?Download WordPress


Insert date in Scroll post excerpt (3 posts)

  1. edmael
    Posted 2 years ago #

    Hi, I'm trying to insert the date in every post that scrolls with this plugin.

    The code I modified is:

    if ( ! empty($spe_data) )
    		$spe_count = 0;
    		foreach ( $spe_data as $spe_data )
    			$spe_post_title = trim($spe_data->post_title, @$spe_excerpt_length);
    			$spe_post_title = mysql_real_escape_string($spe_post_title);
    			$spe_post_date =  trim($spe_data->post_date);
    			$get_permalink = get_permalink($spe_data->ID);
    			$spe_dp_clean =  spe_dp_clean($spe_data->post_content, @$spe_excerpt_length);
    			$spe_dp_clean = mysql_real_escape_string($spe_dp_clean);
    			$dis_height = $dis_num_height."px";
    			$spe_html = $spe_html . "<div class='spe_div' style='height:$dis_height;padding:2px 0px 2px 0px;'>";
    			$spe_html = $spe_html . "<div class='spe_link'><a href='$get_permalink'>$spe_date $spe_post_title</a></div>";
    /*			$spe_html = $spe_html . "<div class='spe_excerpt'>$spe_dp_clean...</div>";*/
    			$spe_html = $spe_html . "</div>";
    			$spe_x = $spe_x . "spe_array[$spe_count] = '<div class=\'spe_div\' style=\'height:$dis_height;padding:2px 0px 2px 0px;\'><div class=\'spe_link\'><a href=\'$get_permalink\'>$spe_post_date $spe_post_title</a></div></div>';"/*<div class=\'spe_excerpt\'>$spe_dp_clean...</div></div>'; "*/;

    I added:
    $spe_post_date = trim($spe_data->post_date);
    but I get the date in this format: 2012-12-05 15:36:54 while I want it to be like this: 05 December, 15:36.
    Is there a simple hack to accomplish this?

  2. arrakis83
    Posted 2 years ago #

    You can use:

    $spe_post_date = mysql2date('d F, H:i', trim($spe_data->post_date));

    The post_date must be in this format: 'Y-m-d H:i:s' (it seems that already is)

  3. Galaxy-Design.co.uk
    Posted 1 year ago #

    Would you guys know by any chance how to show thumbnails?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.