Search

bbPress Showcase » bbPress Chat

  1. kikko088
    User has not uploaded an avatar

    member
    Joined: Aug '10
    Posts: 14

    offline

    Hi at all, i wanto to display on my wordpress home page the last topic or (better) random post, there is a way to do this?or with a plugin or with a simple code?
    thank you

    Francesco

    Posted 1 year ago #
  2. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

  3. kikko088
    User has not uploaded an avatar

    member
    Joined: Aug '10
    Posts: 14

    offline

    thank you very very much!
    I try to do this from months

    kikko088

    Posted 1 year ago #
  4. kikko088
    User has not uploaded an avatar

    member
    Joined: Aug '10
    Posts: 14

    offline

    I have only a last question, on bb template this code display the time of last post in this format 2hours, 1 week ecc...

    echo "<td>topic_id."'>".$result->topic_time."</td></tr>";

    if I put this code on wp, it return the time with data xx/xx/xxxx xx:xx:xx there is a way for display the time with 2hours 1week ecc?

    Posted 1 year ago #
  5. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

    I am not sure what the WP equal is anymore

    try

    human_time_diff(mysql2date('U',$result->topic_time))

    Posted 1 year ago #
  6. kikko088
    User has not uploaded an avatar

    member
    Joined: Aug '10
    Posts: 14

    offline

    it's work perfectly!
    can I take advantage of you?I have another little problem, I put this code on my index.php (wp)
    <?php require('/Applications/MAMP/htdocs/wp/bbpress/bb-load.php'); ?>
    <?php if ( !in_array( bb_get_location(), array( 'login-page', 'register-page' ) ) ) login_form(); ?>

    for put login on the home page, it's work perfectly but if I put this code on sidebar.php nothing, obviously the sidebar was callback with
    <?php get_sidebar(); ?>
    why for you?

    kikko088

    Posted 1 year ago #
  7. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

    Make sure you are only calling the bb-load.php once per page.

    If you can't control that, change require to require_once

    Technically what you are showing me should work in the sidebar.

    I would not use the bbpress login but redirect to wordpress's own.

    You can test if anything is working by changing the if statement to something more simple like

    <?php echo bb_get_location(); ?>

    Posted 1 year ago #
  8. kikko088
    User has not uploaded an avatar

    member
    Joined: Aug '10
    Posts: 14

    offline

    bb-load.php was calling only one time, I solved putting
    <?php require_once('/Applications/MAMP/htdocs/wp/bbpress/bb-load.php'); ?>
    on the home page and this:
    <?php if ( !in_array( bb_get_location(), array( 'login-page', 'register-page' ) ) ) login_form(); ?>
    on sidebar.php

    I don't understand this

    I would not use the bbpress login but redirect to wordpress's own.

    what I would is to have always the bbpress login.

    kikko088

    Posted 1 year ago #

RSS feed for this topic

Post a reply to “Integration”

You must log in to post.

keep _ck_ coding >> donate $5 <<     Theme Switcher:
34 users online from in the past 30 minutes. 14 bots 20 guests
7,229 views today 8,426 yesterday 16,043 peak. Most at once 50 today 62 yesterday 131 peak. Visited today: Amylawrence, guava, JeffreyCasivant, wigbuy123, gdfddfs, nandao, _ck_, summerfortun
2,288 posts in 394 topics over 66 months by 430 of 2,167 members. Latest: watchessaleus, wigbuy123, JeffreyCasivant