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

  • Core Framework (54 posts)
  • Hybrid Theme (22,711 posts)
  • Bliss Theme (255 posts)
  • Options Theme (10,362 posts)
  • Visionary Theme (767 posts)
  • WordPress (144 posts)
  • WordPress Plugins (2,146 posts)
  • bbPress Themes (308 posts)
  • General Discussion (5,572 posts)
  • Critical Theme (0 posts)
  • Hybrid News Theme (132 posts)
  • Hybrid Original Theme (26 posts)
  • Leviathan Theme (16 posts)
  • Life Collage Theme (9 posts)
  • Old School Theme (3 posts)
  • Outline Theme (108 posts)
  • Skeleton Theme (40 posts)
  • Structure Theme (2,768 posts)
  • Members Plugin (2 posts)
  • Cleaner Gallery Plugin (14 posts)
  • Get the Image Plugin (3 posts)
  • Message Board Plugin (0 posts)
  • Widgets Reloaded Plugin (0 posts)
  • Breadcrumb Trail Plugin (0 posts)
  • Query Posts Plugin (80 posts)
  • Hybrid Hook Plugin (7 posts)
  • Hybrid Hook Widgets Plugin (0 posts)
  • Hybrid Tabs (5 posts)