Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Date shown in Default BP theme (14 posts)

Started 1 year, 9 months ago by: podictionary

  • I have a child BP theme built as instructed. I see that blog posts on the default BP theme show time of day but not date. I looked in WP Appearance > Editor and was able to change this for single posts by replacing the_time() with the_date() but I can’t find where I would do that to have all posts appearing on the blog behave the same way.

  • Profile picture of newrambler newrambler said 1 year, 9 months ago:

    I have the same question and came here hoping someone had answered it. I’ll keep poking and post here if I figure anything out.

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    Try editing /single.php and /page.php in your child theme.

    Edit the_time()’s parameters to add the date:

    http://codex.wordpress.org/Function_Reference/the_time

  • Profile picture of Chris O'Brien Chris O’Brien said 1 year, 9 months ago:

    Thanks @r-a-y . That worked for me on the individual blog posts. How do I get the change to also appear on the homepage? That is, when people are on the homepage, they still see the old time-only format. When they click on the post, the time and date appear on the post page.

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    If you’re talking about activity updates, you’ll need to apply a filter to “bp_activity_time_since” (located in bp-activity/bp-activity-templatetags.php).

    Something like this in your theme’s functions.php:

    function my_bp_activity_time_since($relative_time, $activity) {
    // use date parameters – http://php.net/manual/en/function.date.php
    return date(‘FORMAT YOUR TIME’, $activity->date_recorded );
    }
    add_filter( ‘bp_activity_time_since’, ‘my_bp_activity_time_since’, 1, 2 );

  • Profile picture of Chris O'Brien Chris O’Brien said 1 year, 9 months ago:

    I’m not sure it’s the activity updates. See the homepage here: http://nextnewsroom.com. The time at the top of each posts just shows the time, not the date. If you click on the title of post, it displays time and date. Wondering why that change wouldn’t appear on the homepage as well as on the invidividual post?

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    Oh that, you’ll need to modify index.php and do the same thing mentioned three posts above.

  • Profile picture of Chris O'Brien Chris O’Brien said 1 year, 9 months ago:

    @r-a-y Thanks. Do you mean I need to do the same thing I did to /pages and /posts? I did make the change in posts, but not pages. I didn’t see any reference to time in on pages.php or index.php. Any suggestion where I put it?

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    Copy over /bp-themes/bp-default/index.php to your child theme and do the same thing I mentioned here:

    There is a reference to the_time(), so I’m not sure what you’re talking about.

  • Profile picture of Pisanojm Pisanojm said 1 year, 9 months ago:

    Hey @r-a-y I ran into this today as well… This fix is as you said in the files you said.

    Simply delete the existing line and add this line to the files in question:

    -?php the_time(‘F j, Y’); ?- at -?php the_time(‘g:i a’); ?-
    Change – (minus signs) to PHP angled brackets.

    Seems like this should be in the default-theme from the get-go… maybe a ticket?

  • Profile picture of newrambler newrambler said 1 year, 9 months ago:

    I have to admit I’m still confused–there is no the_time() reference in index.php, nor is there any obvious place that I can see where you would insert such a date command. I just want the date of a blog post to appear on the main page, as it would in an ordinary WordPress blog installation, but it’s unclear to me where one would do so.

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    @newrambler – for /index.php, it’s on line 26:

    http://trac.buddypress.org/browser/tags/1.2.5.2/bp-themes/bp-default/index.php

    @pisanojm – maybe a filter on the_time() would suffice, some might like the existing relative time. Definitely create an enhancement ticket!

  • Profile picture of Pisanojm Pisanojm said 1 year, 9 months ago:

    @newrambler this is in the index.php of the buddypress theme… you have to go into the buddypress plugin –> then theme….

  • Profile picture of Pisanojm Pisanojm said 1 year, 9 months ago:

    Ok, New ticket is here:

    http://trac.buddypress.org/ticket/2601