Welcome, guest!

Feel free to read the blog, browse for themes, or join the club.

add date time in recent post function

  1. I am beginner in php.. so I have this trouble to customize code that what I want..

    I want to display recent post with date & time in after primary sidebar and display only in frontpage .. so I put this code below to function.php in child theme

    add_action('hybrid_before_primary', 'myrecentposts');
    
    function myrecentposts() {
    	if(!is_home() || !is_front_page())
    	$args = array(
    		'type' => 'postbypost',
    		'limit' => 5,
    		'echo' => false,
    	);
    	$args = apply_filters('myrecentposts', $args);
    	$archives = '<div id="recentlypost" class="widget widget_recentlypost widget-widget_recentlypost"> <div class="widget-inside"><h3 class="widget-title">Berita Terbaru</h3><ul>';
    	$archives .= str_replace(array("\r", "\n", "\t"), '', wp_get_archives($args));
    	$archives .= '</ul></div></div>';
    	echo $archives;
    }

    that's code it just worked.. but my problem is .. where I should put the get_the_time function so widget will display date time before title & url permalink..

    Thanks for any help..

  2. You must be a logged-in exclusive member to view this reply.

  3. Thanks for your suggestion and explanation..
    Ok I will start from make own widget..

Reply

You must log in to post.

Limited Access

If you have an account, please take a moment to log in.

Non-exclusive members have limited access to the support forums.

To enjoy the full range of support, sign up for an exclusive membership in the theme club.

Support Forums

  • Hybrid Core (1,825 posts)
  • WordPress (4,093 posts)
  • Themes (6 posts)
  • Plugins (2,463 posts)
  • bbPress Themes (323 posts)
  • General Discussion (7,025 posts)
  • Bliss (256 posts)
  • Hybrid (28,641 posts)
  • Critical (133 posts)
  • Hybrid News (2,105 posts)
  • Hybrid Original (306 posts)
  • Leviathan (93 posts)
  • Life Collage (118 posts)
  • Old School (52 posts)
  • Outline (472 posts)
  • Skeleton (498 posts)
  • Structure (2,907 posts)
  • News (48 posts)
  • Options (10,402 posts)
  • Prototype (2,457 posts)
  • Retro-fitted (221 posts)
  • Trending (307 posts)
  • Visionary (778 posts)
  • Members (317 posts)
  • Cleaner Gallery (131 posts)
  • Get the Image (84 posts)
  • Message Board (23 posts)
  • Widgets Reloaded (28 posts)
  • Breadcrumb Trail (18 posts)
  • Query Posts (408 posts)
  • Hybrid Hook (47 posts)
  • Hybrid Hook Widgets (3 posts)
  • Hybrid Tabs (97 posts)